﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta charset="UTF-8">
    <title>贴吧</title>
</head>
<body>

<div id="setUserPrivilege" style="display: none;">
    <button type="button" @click="quitSetUserPrivilege">返回</button>
    <br>
    <label>所有用户权限封禁详情：</label>
    <li v-for="perUser in totalUsers">
        {{"用户id: " + perUser.id + " 用户名: " + perUser.userName + " 性别：" + perUser.gender + " 邮箱：" + perUser.email}}
        <br>
        <label v-show="perUser.activationStatus==1">用户当前登录状态：正常</label>
        <label v-show="perUser.activationStatus==0">用户当前登录状态：封禁</label>
        <br>
        <label>用户头像：</label>
        <br>
        <img id="image2" style="width: 100px;height: 80px" v-bind:src="perUser.imagePath" title="img">
        <br>

        <select id="privilegeSelect" v-model="eachPermissionInBlacklist.banPermissionName">
            <option value="">请选择封禁的权限分类：</option>
            <!--             v-bind-->
            <option v-for="permission in userPermissions" :value="permission.permissionName">
                {{permission.permissionName}}
                <input type="datetime-local" name="timestamp" id="timestamp"
                       v-model="eachPermissionInBlacklist.openDate">
                <button type="button" @click="setUserPrivilege(perUser)">保存权限封禁设置</button>
            </option>
        </select>

        <div v-for="losePermission in PermissionBlacklist" v-show="losePermission.banUserId==perUser.id">
            {{"用户已经被封禁的权限有：" + losePermission.banPermissionName + "  解封日期："
        + new Date(losePermission.openDate).toLocaleDateString() }}
            <button type="button" @click="cancelSetUserPrivilege(losePermission)">取消封禁</button>
            <br>
        </div>
    </li>
</div>


<div id="administratorLoginApp" style="display: none;">
    <h4>管理员登录</h4>
    <form>
        <label>管理员账户：</label>
        <input type="text" v-model="administratorAccount" placeholder="管理员账户">
        <br>
        <label>密码：</label>
        <input type="password" name="password" v-model="administratorPassword" placeholder="密码">
        <br>
        <button type="button" @click="administratorLogin">管理员登录</button>
        <button type="button" @click="cancelAdministratorLogin">取消登录</button>
    </form>
</div>

<div id="afterAdministratorLoginApp" style="display: none;">
    <button type="button" id="seeUncheckedQuestion">审核等待上传的问题</button>
    <button type="button" id="seeQuestionsReported">审核被举报的问题</button>
    <button type="button" id="seeReportedComment">审核被举报的评论</button>
    <br>
    <button type="button" id="BanUserButton">封禁用户</button>
    <button type="button" id="setUserPermission">设置用户权限</button>
</div>

<div id="checkWaitingQuestionApp" style="display: none;">
    <ul>
        <button type="button" @click="backMenu">返回首页</button>
        <br>
        <label>等待上传审核的问题名单，相关问题均已经通过敏感词汇校验检测：</label>
        <ul>
            <li v-for="uncheckedQuestionItem in uncheckedQuestionList">
                {{"问题标题：" + uncheckedQuestionItem.title}}
                <br>
                {{"分类：" + uncheckedQuestionItem.classification + "  问题提交时间：" + new Date(uncheckedQuestionItem.launchTime).toLocaleDateString()}}
                <br>
                {{"内容：" + uncheckedQuestionItem.content}}
                <br>
                {{"目前问题未通过审核原因：" + uncheckedQuestionItem.checkIllegalReason}}
                <br>
                <button type="button" @click="agreedPublishQuestion(uncheckedQuestionItem)">通过审核</button>
                <button type="button" @click="disagreedPublishQuestion(uncheckedQuestionItem)">驳回发布请求</button>
                <br>
            </li>
        </ul>
    </ul>
</div>

<div id="readQuestionDetails" style="display: none;">
    <button type="button" @click="quitReadQuestionDetailsButton">返回</button>
    <br>
    <label>问题详情：</label>
    {{"问题标题：" + everyCollectQuestion.title}}
    <br>
    {{"分类：" + everyCollectQuestion.classification + "  问题提交时间：" + new Date(everyCollectQuestion.launchTime).toLocaleDateString()}}
    <br>
    {{"内容：" + everyCollectQuestion.content}}
    <br>
    {{"点赞数量：" + everyCollectQuestion.likeCount}}
    <br>
</div>

<div id="readMyPursueUserQuestion" style="display: none;">
    <ul>
        <button type="button" @click="goMenu">返回首页</button>
        <button type="button" @click="rankByLikesCount">按点赞数量排序</button>
        <button type="button" @click="rankByLaunchTime">按最新发布时间排序</button>
        <br>
        <label>根据关注的用户进行问题推送：</label>
        <ul>
            <li v-for="myPursueUserQuestion in myPursueUserQuestions">
                {{"问题标题：" + myPursueUserQuestion.title}}
                <br>
                {{"分类：" + myPursueUserQuestion.classification + "  问题提交时间：" + new Date(myPursueUserQuestion.launchTime).toLocaleDateString()}}
                <br>
                {{"内容：" + myPursueUserQuestion.content}}
                <br>
                {{"问题点赞数量：" + myPursueUserQuestion.likeCount}}
            </li>
        </ul>
    </ul>
</div>

<div id="readMyCollectQuestions" style="display: none;">
    <ul>
        <button type="button" @click="quitSeeMyCollectQuestionsButton">返回首页</button>
        <br>
        <label>我的问题收藏夹：</label>
        <ul>
            <li v-for="myCollectQuestion in myCollectQuestions">
                {{"问题标题：" + myCollectQuestion.questionTitle}}
                <button type="button" @click="seeQuestionDetails(myCollectQuestion)">查看问题详情</button>
            </li>
        </ul>
    </ul>
</div>

<div id="readMyPursueTopicQuestion" style="display: none;">
    <ul>
        <button type="button" @click="comeBackPrevious">返回</button>
        <button type="button" @click="rankInterestedQuestionByLikes">按点赞数量排序</button>
        <button type="button" @click="rankInterestedQuestionByLaunchTime">按最新发布时间排序</button>
        <br>
        <label>根据关注的话题进行问题推送：</label>
        <ul>
            <li v-for="myPursueTopicQuestion in myPursueTopicQuestions">
                {{"问题标题：" + myPursueTopicQuestion.title}}
                <br>
                {{"分类：" + myPursueTopicQuestion.classification + "  问题提交时间：" + new Date(myPursueTopicQuestion.launchTime).toLocaleDateString()}}
                <br>
                {{"内容：" + myPursueTopicQuestion.content}}
                <br>
                {{"问题点赞数量：" + myPursueTopicQuestion.likeCount}}
            </li>
        </ul>
    </ul>
</div>

<div id="checkReportedQuestionApp" style="display: none;">
    <ul>
        <button type="button" @click="returnMenu">返回首页</button>
        <br>
        <label>被举报的问题名单：</label>
        <ul>

            <li v-for="questionReportedItem in reportedQuestionList">
                {{"问题标题：" + questionReportedItem.title}}
                <br>
                {{"分类：" + questionReportedItem.classification + "  问题提交时间：" + new Date(questionReportedItem.launchTime).toLocaleDateString()}}
                <br>
                {{"内容：" + questionReportedItem.content}}
                <br>
                {{"问题被举报的原因：" + questionReportedItem.reportIllegalReason}}
                <br>
                <button type="button" @click="agreedReportQuestion(questionReportedItem)">同意举报</button>
                <button type="button" @click="disagreedReportQuestion(questionReportedItem)">驳回举报请求</button>
                <br>
            </li>
        </ul>
    </ul>
</div>

<div id="checkReportedCommentApp" style="display: none;">
    <ul>
        <button type="button" @click="toMenu">返回首页</button>
        <br>
        <label>被举报的评论名单：</label>
        <ul>
            <li v-for="commentReportedItem in reportedCommentList">
                {{"发表该评论的用户id：" + commentReportedItem.answerCommentUserId + " 评论的用户名：" + commentReportedItem.commentUserName}}
                <br>
                {{"内容：" + commentReportedItem.content}}
                <br>
                {{"评论被举报的原因：" + commentReportedItem.reportIllegalReason}}
                <br>
                <button type="button" @click="agreedReportComment(commentReportedItem)">同意举报</button>
                <button type="button" @click="disagreedReportComment(commentReportedItem)">驳回举报请求</button>
                <br>
            </li>
        </ul>
    </ul>
</div>

<div id="rejectPublishQuestionApp" style="display: none;">
    <label>驳回发布问题的请求：</label><br>
    <textarea name="content" rows="5" cols="50" placeholder="驳回理由详情" v-model="rejectPublishQuestionReason"
              required></textarea>
    <br>
    <button type="button" @click="sendRejectQuestion">提交审核</button>
    <button type="button" @click="cancelRejectQuestion">取消驳回</button>
</div>

<div id="deFriendApp" style="display: none;">
    <ul>
        <button type="button" @click="comBackApp">返回首页</button>
        <br>
        <label>贴吧所有用户信息：</label>

        <li v-for="eachUser in userList">
            {{"用户id: " + eachUser.id + " 用户名: " + eachUser.userName + " 性别：" + eachUser.gender + " 邮箱：" + eachUser.email}}
            <br>
            <label v-show="eachUser.activationStatus==1">用户当前状态：正常</label>
            <label v-show="eachUser.activationStatus==0">用户当前状态：封禁</label>
            <br>
            <label>用户头像：</label>
            <br>
            <img id="image" style="width: 100px;height: 80px" v-bind:src="eachUser.imagePath" title="img">
            <br>
            <button type="button" @click="deFriend(eachUser)">拉黑</button>
            <br>
        </li>
    </ul>
</div>

<div id="pursueUsersApp" style="display: none;">
    <ul>
        <button type="button" @click="moveBackApp">返回首页</button>
        <br>
        <label>贴吧所有尚未关注的用户信息：</label>
        <li v-for="pursuingUser in pursuingUsers">
            {{"用户id: " + pursuingUser.id + " 用户名: " + pursuingUser.userName + " 性别：" + pursuingUser.gender +
        " 邮箱：" + pursuingUser.email + " 关注的粉丝数； " + pursuingUser.fansCount}}
            <br>
            <label v-show="pursuingUser.activationStatus==1">用户当前状态：正常</label>
            <label v-show="pursuingUser.activationStatus==0">用户当前状态：封禁</label>
            <br>
            <label>用户头像：</label>
            <br>
            <img style="width: 100px;height: 80px" v-bind:src="pursuingUser.imagePath" title="img">
            <br>
            <button type="button" @click="pursueUser(pursuingUser)">关注</button>
            <br>
        </li>
    </ul>
</div>

<div id="showNotPursueTopicsApp" style="display: none;">
    <ul>
        <button type="button" @click="comeBackApp">返回首页</button>
        <br>
        <label>贴吧所有尚未关注的话题信息：</label>
        <li v-for="notPursueTopicItem in NotPursueTopics">
            {{notPursueTopicItem.topicName}}
            <button type="button" @click="pursueTopic(notPursueTopicItem)">关注话题</button>
        </li>
    </ul>
</div>

<div id="showPursueTopicsApp" style="display: none;">
    <ul>
        <button type="button" @click="goBackApp">返回首页</button>
        <br>
        <label>贴吧所有关注的话题信息：</label>
        <li v-for="pursueTopicItem in pursueTopics">
            {{pursueTopicItem.topicName}}
            <button type="button" @click="cancelPursueTopic(pursueTopicItem)">取消关注话题</button>
        </li>
    </ul>
</div>

<div id="myPursueUsersApp" style="display: none;">
    <ul>
        <button type="button" @click="moveApp">返回首页</button>
        <br>
        <label>贴吧我关注的用户信息：</label>
        <li v-for="pursuedUser in pursuedUsers">
            {{"用户id: " + pursuedUser.id + " 用户名: " + pursuedUser.userName + " 性别：" + pursuedUser.gender +
        " 邮箱：" + pursuedUser.email + " 关注的粉丝数； " + pursuedUser.fansCount}}
            <br>
            <label v-show="pursuedUser.activationStatus==1">用户当前状态：正常</label>
            <label v-show="pursuedUser.activationStatus==0">用户当前状态：封禁</label>
            <br>
            <label>用户头像：</label>
            <br>
            <img style="width: 100px;height: 80px" v-bind:src="pursuedUser.imagePath" title="img">
            <br>
            <button type="button" @click="cancelPursueUser(pursuedUser)">取消关注</button>
            <button type="button" @click="seeOurCommonPursueUsers(pursuedUser)">查看我们的共同关注列表</button>
            <br>
        </li>
    </ul>
</div>

<div id="commonPursueUsersApp" style="display: none;">
    <ul>
        <button type="button" @click="returnBackApp">返回</button>
        <br>
        <label>我们共同关注的用户：</label>
        <li v-for="commonPursueUser in commonPursueUsers">
            {{"用户id: " + commonPursueUser.id + " 用户名: " + commonPursueUser.userName + " 性别：" + commonPursueUser.gender +
        " 邮箱：" + commonPursueUser.email + " 关注的粉丝数； " + commonPursueUser.fansCount}}
            <br>
            <label v-show="commonPursueUser.activationStatus==1">用户当前状态：正常</label>
            <label v-show="commonPursueUser.activationStatus==0">用户当前状态：封禁</label>
            <br>
            <label>用户头像：</label>
            <br>
            <img style="width: 100px;height: 80px" v-bind:src="commonPursueUser.imagePath" title="img">
            <br>
        </li>
    </ul>
</div>

<div id="searchUsersApp" style="display: none;">
    <ul>
        <button type="button" @click="quitSearch">返回首页</button>
        <br>
        <label>符合条件的用户信息：</label>
        <li v-for="searchUserItem in searchUsers">
            {{"用户id: " + searchUserItem.id + " 用户名: " + searchUserItem.userName + " 性别："
        + searchUserItem.gender + " 邮箱：" + searchUserItem.email}}
            <br>
            <label v-show="searchUserItem.activationStatus==1">用户当前状态：正常</label>
            <label v-show="searchUserItem.activationStatus==0">用户当前状态：封禁</label>
            <br>
            <label>用户头像：</label>
            <br>
            <img style="width: 100px;height: 80px" v-bind:src="searchUserItem.imagePath" title="img">
            <br>
            <div v-for="hisQuestion in  hisQuestionList" v-show=" hisQuestion.publishUserId== searchUserItem.id">
                {{"用户发表了标题为：" + hisQuestion.title + " 的问题"}}
                <br>
                {{"分类：" + hisQuestion.classification}}
                <br>
                {{"具体内容：" + hisQuestion.content}}
                <br>
                <br>
            </div>
            <br>
        </li>
    </ul>
</div>

<div id="searchQuestionsApp" style="display: none;">
    <ul>
        <button type="button" @click="quitSearchQuestion">返回首页</button>
        <br>
        <label>符合条件的问题信息：</label>
        <li v-for="searchQuestionItem in searchQuestionList">
            {{"用户id为 " + searchQuestionItem.publishUserId + " 的用户发表了标题为：" + searchQuestionItem.title + " 的问题"}}
            <br>
            {{"分类：" + searchQuestionItem.classification}}
            <br>
            {{"具体内容：" + searchQuestionItem.content}}
            <br>
            <br>
        </li>
    </ul>
</div>

<div id="banUserApp" style="display: none;">
    <ul>
        <button type="button" @click="leave">返回首页</button>
        <br>
        <label>贴吧所有用户信息：</label>
        <li v-for="userItem in users">
            {{"用户id: " + userItem.id + " 用户名: " + userItem.userName + " 性别：" + userItem.gender + " 邮箱：" + userItem.email}}
            <br>
            <label v-show="userItem.activationStatus==1">用户当前状态：正常</label>
            <label v-show="userItem.activationStatus==0">用户当前状态：封禁</label>
            <br>
            <label>用户头像：</label>
            <br>
            <img style="width: 100px;height: 80px" v-bind:src="userItem.imagePath" title="img">
            <br>
            <button type="button" @click="banUser(userItem)" v-show="userItem.activationStatus==1">封禁</button>
            <button type="button" @click="cancelBanUser(userItem)" v-show="userItem.activationStatus==0">取消封禁</button>
            <br>
        </li>
    </ul>
</div>

<div id="readMyDeFriendApp" style="display: none;">
    <ul>
        <button type="button" @click="comBackMenu">返回首页</button>
        <br>
        <label>我的黑名单：</label>

        <li v-for="eachBlackUser in BlackUserList">
            {{"用户id: " + eachBlackUser.id + " 用户名: " + eachBlackUser.userName + " 性别：" + eachBlackUser.gender + " 邮箱：" + eachBlackUser.email}}
            <br>
            <label v-show="eachBlackUser.activationStatus==1">用户当前状态：正常</label>
            <label v-show="eachBlackUser.activationStatus==0">用户当前状态：封禁</label>
            <br>
            <label>用户头像：</label>
            <br>
            <img style="width: 100px;height: 80px" v-bind:src="eachBlackUser.imagePath" title="img">
            <br>
            <button type="button" @click="cancelDeFriend(eachBlackUser)">取消拉黑</button>
            <br>
        </li>
    </ul>
</div>

<div id="answerQuestionApp" style="display: none;">
    <label>回答问题：</label><br>
    <textarea name="content" rows="2" cols="50" placeholder="回答详情" v-model="answer.content" required></textarea>
    <br>
    <button type="button" @click="sendAnswer()">发送</button>
    <button type="button" @click="cancelAnswer">取消回答</button>
</div>

<div id="editImageApp" style="display: none;">
    <label>编辑个人头像：</label><br>
    <!--    <form action="user/editImage" method="post" enctype="multipart/form-data">-->
    <form enctype="multipart/form-data">
        <br>
        <img id="editImagePath" style="width: 100px;height: 80px" v-bind:src="this.editImagePath" title="img">
        <br>
        <label>选择文件后实现自动上传</label>
        <br>
        <!--        <input type="file" name="imageFile" >-->
        <input type="file" @change="handleFileChange">
        <!--        <input type="submit" value="上传">-->
    </form>
    <br>
    <button type="button" @click="cancelEditImage">返回主页面</button>

</div>

<div id="editProfileApp" style="display: none;">
    <label>编辑个人信息：</label><br>
    <label>校验当前用户密码：</label>
    <input type="password" name="password" v-model="originPassword" placeholder="密码校验失败将无法修改信息"><br>
    <label>用户名：</label>
    <input type="text" name="userName" v-model="editUser.userName" placeholder="用户名"><br>
    <label for="genderSelect">性别：</label>
    <select id="genderSelect" v-model="editUser.gender">
        <option value="">请选择性别：</option>
        <option value="男">男</option>
        <option value="女">女</option>
        <option value="未知">未知</option>
    </select>
    <br>
    <label>当前头像：</label>
    <br>
    <img id="ImagePath" style="width: 100px;height: 80px" v-bind:src="editUser.imagePath" title="img">
    <br>
    <button type="button" @click="cancelEditProfile">返回首页</button>
    <button type="button" @click="sendEditProfile">提交修改</button>
</div>

<div id="answerCommentApp" style="display: none;">
    <label>评论：</label><br>
    <textarea name="content" rows="2" cols="50" placeholder="评论详情" v-model="answerComment.content" required></textarea>
    <br>
    <button type="button" @click="sendAnswerComment()">发送</button>
    <button type="button" @click="cancelComment">取消评论</button>
</div>

<div id="reportQuestionApp" style="display: none;">
    <label>举报：</label><br>
    <textarea name="content" rows="5" cols="50" placeholder="举报理由详情" v-model="reportQuestionReason" required></textarea>
    <br>
    <button type="button" @click="sendReportQuestion">提交举报</button>
    <button type="button" @click="cancelReportQuestion">取消举报</button>
</div>

<div id="reportCommentApp" style="display: none;">
    <label>举报：</label><br>
    <textarea name="content" rows="5" cols="50" placeholder="举报理由详情" v-model="reportCommentReason" required></textarea>
    <br>
    <button type="button" @click="sendReportComment">提交举报</button>
    <button type="button" @click="cancelReportComment">取消举报</button>
</div>

<div id="app">
    <button id="administratorLoginButton">管理员登录</button>
    <button id="userLogin">用户登录</button>
    <button id="userRegister">用户注册</button>
    <button id="moreFunction">更多功能</button>
    <button id="updatePostData" @click="updateData">刷新贴吧数据</button>

    <ul>
        <li v-for="questionItem in questionList">
            {{"id为" + questionItem.publishUserId + "的用户发表了标题为：" + questionItem.title + " 的问题"}}
            <br>
            {{"分类：" + questionItem.classification}}
            <br>
            {{"具体内容：" + questionItem.content}}
            <br>
            {{"发布时间：" + new Date(questionItem.launchTime).toLocaleDateString()}}
            <br>
            {{"该问题收到点赞数量为 " + questionItem.likeCount + "条"}}
            <br>
            <div v-for="answerItem in  answerList" v-show=" answerItem.questionId== questionItem.id">
                {{"id为" + answerItem.answerUserId + "的用户回答说：" + answerItem.content}}
                <br>
                <div v-for="answerCommentItem in  answerCommentList" v-show="
               answerCommentItem.answerId==answerItem.id">
                    {{"id为" + answerCommentItem.answerCommentUserId + "的用户评论上面的回答说："
                + answerCommentItem.content}}
                </div>
                <br>
            </div>
        </li>
    </ul>
</div>

<div id="askQuestionApp" style="display: none;">
    <h1>提出问题</h1>
    <form>
        <label>问题标题：</label>
        <input type="text" name="title" v-model="question.title" placeholder="问题标题">
        <br>
        <label for="select">问题分类：</label>
        <select id="select" v-model="question.classification">
            <option value="">请选择问题分类</option>
            <option value="技术">技术</option>
            <option value="学习">学习</option>
            <option value="爱情">爱情</option>
            <option value="运动">运动</option>
            <option value="健康">健康</option>
            <option value="胡思乱想">胡思乱想</option>
            <option value="生活">生活</option>
            <option value="友情">友情</option>
            <option value="就业">就业</option>
            <option value="饮食">饮食</option>
            <option value="科普">科普</option>
            <option value="其他">其他</option>
        </select>
        <br>

        <label>问题内容：</label>
        <textarea name="content" rows="20" cols="80" placeholder="问题详情" v-model="question.content" required></textarea>
        <br>
        <!--        用button不用其他类型-->
        <input type="button" value="提交问题" @click="commitQuestion">
        <button type="button" @click="cancelAsk">取消提问</button>
    </form>
</div>

<div id="sendMessageApp" style="display: none;">
    <label>发送私信：</label><br>
    <textarea name="content" rows="2" cols="50" placeholder="私信详情" v-model="privateMessage.content" required></textarea>
    <br>
    <button type="button" @click="sendMessage">发送</button>
    <button type="button" @click="cancelSendMessage">取消发送</button>
</div>

<div id="answerMessageApp" style="display: none;">
    <label>回复私信：</label><br>
    <textarea name="content" rows="2" cols="50" placeholder="回复的私信详情" v-model="answerPrivateMessage.content"
              required></textarea>
    <br>
    <button type="button" @click="sendAnswerMessage">发送</button>
    <button type="button" @click="cancelSendAnswerMessage">取消发送</button>
</div>

<div id="updatePasswordApp" style="display: none;">
    <label>校验当前用户密码：</label>
    <input type="password" name="password" v-model="oldPassword" placeholder="密码校验失败将无法修改密码">
    <br>
    <input type="password" name="password" v-model="newPassword" placeholder="新密码">
    <button type="button" @click="updatePassword">修改密码</button>
    <button type="button" @click="cancelUpdatePassword">返回首页</button>
</div>

<div id="afterLogin" style="display: none;">
    <button type="button" id="editImage">更换头像</button>
    <button type="button" @click="editPersonalInformation">编辑个人信息</button>
    <button type="button" id="updatePasswordButton">修改密码</button>
    <button type="button" id="seeMySendMessage">查看我发出的私信</button>
    <button type="button" id="seeMyGetMessage">查看我收到的私信</button>
    <br>
    <button type="button" id="askQuestion">提出问题</button>
    <button type="button" id="deFriends">拉入黑名单</button>
    <button type="button" id="seeMyDeFriend">查看我的黑名单</button>
    <button id="refreshPost" @click="showPost1">刷新贴吧界面</button>
    <br>
    <button type="button" id="seeNotPassQuestion">查看我未通过审核的问题</button>
    <button type="button" id="seeReportedQuestion">查看我被举报的问题</button>
    <button type="button" id="seePursuingUsers">关注用户</button>
    <button type="button" id="seePursuedUsers">查看我关注的用户</button>
    <br>
    <button type="button" id="seeNotPursuedTopics">查看未关注的话题</button>
    <button type="button" id="seePursuedTopics">查看已经关注的话题</button>
    <button type="button" id="seePursuedHotTopics">查看我关注的热门话题</button>
    <button type="button" id="seeMyCollectQuestion">查看我的收藏夹</button>
    <br>
    <button type="button" @click="rankQuestionByLikesCount">首页帖子按点赞数量排序</button>
    <button type="button" id="seeMyPursueUserQuestion">查看我关注的用户发布问题的历史</button>
    <form>
        <input type="text" v-model="myInterestedQuestion" placeholder="搜索你感兴趣的问题的标题...">
        <button type="button" @click="searchQuestion()">搜索问题</button>
    </form>

    <form>
        <input type="text" v-model="myInterestedUser" placeholder="搜索你感兴趣的用户...">
        <button type="button" @click="searchUser()">搜索用户</button>
    </form>

    <ul>
        <li v-for="questionItem in questionList">
            {{"用户id为" + questionItem.publishUserId + "的用户发表了标题为：" + questionItem.title + "的问题"}}
            <br>
            {{"分类：" + questionItem.classification}}
            <br>
            <button type="button" @click="reportQuestion(questionItem)">举报</button>
            <button type="button" @click="collectQuestion(questionItem)">收藏问题</button>
            <button v-show="user.id!=null" @click="ReadyAnswer(questionItem)">回答</button>
            <button v-show="user.id!=null" @click="ReadySendMessage(questionItem)">私信问题发布者</button>
            <br>
            {{" 具体内容：" + questionItem.content}}
            <div v-for="answerItem in answerList" v-show="answerItem.questionId==questionItem.id">
                {{"用户id为" + answerItem.answerUserId + "的用户回答说：" + answerItem.content}}
                <br>
                <button v-show="user.id!=null" @click="comment(questionItem,answerItem)">对该条回答进行评论
                </button>

                <br>
                <div v-for="answerCommentItem in answerCommentList" v-show="
                answerCommentItem.answerId==answerItem.id">
                    {{"用户id为" + answerCommentItem.answerCommentUserId + "评论上面的回答说："
                + answerCommentItem.content}}
                    <br>
                    <button type="button" @click="reportComment(answerCommentItem)">举报评论</button>
                </div>
            </div>
            <br>
            {{"该问题收到点赞数量为" + questionItem.likeCount}}
            <br>
            <button v-show="user.id!=null" @click="addLike(questionItem)">点赞该问题</button>
            <br>
        </li>
    </ul>
    <!--分页工具条-->
    <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="currentPage"
            :page-sizes="[5, 10, 15, 20]"
            :page-size="pageSize"
            layout="total, sizes, prev, pager, next, jumper"
            :total="allCount">
    </el-pagination>

</div>

<div id="readMySendMessageApp" style="display: none;">
    <button type="button" @click="returnApp">返回首页</button>
    <ul>
        <li v-for="sendMessageItem in privateSendMessageList">
            {{"你私信用户id为" + sendMessageItem.toUserId + "的用户，" + " 私信内容如下："}}
            <br>
            {{sendMessageItem.content}}
            <br>
        </li>
    </ul>
</div>

<div id="readNotPassQuestionApp" style="display: none;">
    <button type="button" @click="returnMyApp">返回首页</button>
    <label>目前未审核通过的问题：</label><br>
    <ul>
        <li v-for="NotPassQuestionItem in NotPassQuestionList">
            {{"问题标题：" + NotPassQuestionItem.title}}
            <br>
            {{"分类：" + NotPassQuestionItem.classification + "  问题提交时间：" + new Date(NotPassQuestionItem.launchTime).toLocaleDateString()}}
            <br>
            {{"内容：" + NotPassQuestionItem.content}}
            <br>
            {{"目前问题未通过审核原因：" + NotPassQuestionItem.checkIllegalReason}}
            <br>
        </li>
    </ul>
</div>

<div id="readReportedQuestionApp" style="display: none;">
    <button type="button" @click="returnMyMenu">返回首页</button>
    <label>目前收到举报的问题：</label><br>
    <ul>
        <li v-for="ReportedQuestionItem in ReportedQuestionList">
            {{"问题标题：" + ReportedQuestionItem.title}}
            <br>
            {{"分类：" + ReportedQuestionItem.classification + "  问题提交时间：" + new Date(ReportedQuestionItem.launchTime).toLocaleDateString()}}
            <br>
            {{"内容：" + ReportedQuestionItem.content}}
            <br>
            {{"问题被举报的原因：" + ReportedQuestionItem.reportIllegalReason}}
            <br>
        </li>
    </ul>
</div>

<div id="readMyGetMessageApp" style="display: none;">
    <button type="button" @click="backApp">返回首页</button>
    <ul>
        <li v-for="getMessageItem in privateGetMessageList">
            {{"id为" + getMessageItem.fromUserId + "且用户名为 " + getMessageItem.fromUserName + " 的用户私信了你，" + "内容如下："}}
            <br>
            {{getMessageItem.content}}
            <br>
            <button type="button" @click="answerMessage(getMessageItem)">回复私信</button>
        </li>
    </ul>
</div>

<div id="loginApp" style="display: none;">
    <h1>登录</h1>
    <button type="button" id="comeApp">返回主页</button>
    <form>
        <label>邮箱：</label>
        <input type="text" name="email" v-model="user1.email" placeholder="邮箱"><br>
        <label>密码：</label>
        <input type="password" name="password" v-model="user1.password" placeholder="密码"><br>
        <label>图形验证码：</label>
        <input type="text" name="checkCode" id="checkCode" v-model="user1.checkCode" placeholder="验证码">
        <img id="checkCodeImage" src="http://localhost:8080/demo01/checkCodeServlet" title="img">
        <button type="button" id="imageChange" @click="updateCheckCode">更换验证码</button>
        <br>
        <button type="button" @click="login">登录</button>
        <button type="button" id="forgetPassword">忘记密码</button>
    </form>
</div>

<div id="registerApp" style="display: none">
    <h1>注册</h1>
    <form>
        <label>邮箱：</label>
        <input type="email" name="email" v-model="user2.email" placeholder="邮箱"><br>
        <label>密码：</label>
        <input type="password" name="password" v-model="user2.password" placeholder="密码"><br>
        <label>图形验证码：</label>
        <input type="text" name="checkCode" id="checkCode1" v-model="user2.checkCode2" placeholder="验证码">
        <img id="checkCodeImage1" src="http://localhost:8080/demo01/checkCodeServlet" title="img1">
        <button type="button" id="imageChange1" @click="updateCheckCode1">更换验证码</button>
        <br>
        <button type="button" @click="register">注册</button>
    </form>
</div>

<div id="forgetPasswordApp" style="display: none">
    <h1>忘记密码</h1>
    <form>
        <label>邮箱：</label>
        <input type="email" name="email" placeholder="邮箱" v-model="user3.email"><br>
        <label>邮箱验证码：</label>
        <input type="text" name="verification_code" placeholder="4位数字验证码" v-model="user3.emailCheckCode"><br>
        <button type="button" @click="sendEmailCode">发送验证码</button>
        <br>
        <label>新密码：</label>
        <input type="password" name="new_password" placeholder="新密码" v-model="user3.password"><br>
        <button type="button" @click="forgetPassword">提交</button>
    </form>
</div>

</body>

<script src="js/vue.js"></script>
<script src="element-ui/lib/index.js"></script>
<link rel="stylesheet" href="element-ui/lib/theme-chalk/index.css">
<script src="js/axios-0.18.0.js"></script>

<script>
    var administratorLoginAppVue = new Vue({
        el: "#administratorLoginApp",
        data() {
            return {
                administratorAccount: "",
                administratorPassword: "",
            }
        },
        methods: {
            cancelAdministratorLogin() {
                this.administratorAccount = "";
                this.administratorPassword = "";
                document.getElementById("app").style.display = "";
                document.getElementById("administratorLoginApp").style.display = "none";
            },

            administratorLogin() {
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/administrator/administratorLogin?administratorAccount="
                        + this.administratorAccount + "&administratorPassword=" + this.administratorPassword,
                }).then(function (resp) {
                    alert(resp.data.result);
                    if (resp.data.status == 1) {
                        document.getElementById("administratorLoginApp").style.display = "none";
                        document.getElementById("afterAdministratorLoginApp").style.display = "";
                    }
                })
            },
        },
    });


</script>


<script>
    var app = new Vue({
        el: "#app",
        mounted() {
            this.showPost();
        },
        data() {
            return {
                allCount: 0,
                questionList: [{
                    id: 1,
                    title: "问题无标题",
                    content: "问题无内容",
                    classification: "问题无分类",
                    publishUserId: 1,
                    likeCount: 0,
                    reportStatus: 1,
                    reportIllegalReason: "问题无举报原因",
                    checkStatus: 0,
                    checkIllegalReason: "问题未过审",
                    launchTime: null,
                },],
                answerList: [{
                    id: 1,
                    answerUserId: 1,
                    content: "无内容",
                    questionId: 1,
                    answerUserName: "者为匿名",
                    questionUserId: 1
                },],
                answerCommentList: [{
                    id: 1,
                    content: "评论无内容",
                    answerCommentUserId: 1,
                    answerId: 1,
                    answerUserId: 1,
                    reportStatus: 1,
                    reportIllegalReason: "评论无举报原因",
                    commentUserName: "评论者为匿名",
                },],
            }
        },
        methods: {
            updateData() {
                this.showPost();
            },
            //查询分页后当前页面的数据
            showPost() {
                var _this = this;
                //当页面加载完成后，发送异步请求，获取数据
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/user/showPost",
                }).then(function (resp) {
                    //设置前端数组数据
                    _this.questionList = resp.data.questionList;
                    _this.answerList = resp.data.answerList;
                    _this.answerCommentList = resp.data.answerCommentList;
                    //设置问题总记录数
                    _this.allCount = resp.data.allCount;
                })
            },
        },
    });
    document.getElementById("userLogin").onclick = function () {
        document.getElementById("app").style.display = "none";
        document.getElementById("loginApp").style.display = "";
    };

    document.getElementById("userRegister").onclick = function () {
        document.getElementById("app").style.display = "none";
        document.getElementById("registerApp").style.display = "";
    }
    document.getElementById("moreFunction").onclick = function () {
        alert("你尚未登录，请先登录或注册新用户");
    }
    document.getElementById("administratorLoginButton").onclick = function () {
        administratorLoginAppVue.$data.administratorAccount = "";
        administratorLoginAppVue.$data.administratorPassword = "";
        document.getElementById("app").style.display = "none";
        document.getElementById("administratorLoginApp").style.display = "";
    }

</script>

<script>
    var readMySendMessageAppVue = new Vue({
        el: "#readMySendMessageApp",
        data() {
            return {
                privateSendMessageList: [{
                    id: 0,
                    content: "",
                    fromUserId: 0,
                    toUserId: 0,
                    fromUserName: "",
                },],
            }
        },
        methods: {
            //查询分页后当前页面的数据
            showMySendMessage() {
                var _this = this;
                //当页面加载完成后，发送异步请求，获取数据
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/privateMessage/readMySendMessage",
                }).then(function (resp) {
                    if (resp.data.totalCount > 0) {
                        //设置前端数组数据
                        _this.privateSendMessageList = resp.data.rows;
                    } else {
                        alert("你尚未发送过私信给其他用户哦,请先返回首页发送私信哦");
                    }
                })
            },
            returnApp() {
                document.getElementById("app").style.display = "none";
                document.getElementById("loginApp").style.display = "none";
                document.getElementById("registerApp").style.display = "none";
                document.getElementById("afterLogin").style.display = "";
                document.getElementById("forgetPasswordApp").style.display = "none";
                document.getElementById("askQuestionApp").style.display = "none";
                document.getElementById("readMySendMessageApp").style.display = "none";
            },
        },

    });
</script>

<script>
    var readNotPassQuestionAppVue = new Vue({
        //未通过管理员审核的问题
        el: "#readNotPassQuestionApp",
        data() {
            return {
                NotPassQuestionList: [{
                    id: 0,
                    title: "",
                    content: "",
                    classification: "",
                    publishUserId: 0,
                    likeCount: 0,
                    reportStatus: 1,
                    reportIllegalReason: "",
                    checkStatus: 0,
                    checkIllegalReason: "",
                    launchTime: null,
                },],
            }
        },
        methods: {
            //查询分页后当前页面的数据
            showNotPassQuestion() {
                var _this = this;
                //当页面加载完成后，发送异步请求，获取数据
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/question/showNotPassQuestion",
                }).then(function (resp) {
                    if (resp.data.totalCount > 0) {
                        //设置前端数组数据
                        _this.NotPassQuestionList = resp.data.rows;
                        document.getElementById("afterLogin").style.display = "none";
                        document.getElementById("readNotPassQuestionApp").style.display = "";
                    } else {
                        alert("你当前没有未通过管理员审核的问题");
                    }
                })
            },
            returnMyApp() {
                document.getElementById("afterLogin").style.display = "";
                document.getElementById("readNotPassQuestionApp").style.display = "none";
            },
        },
    });
</script>

<script>
    var readReportedQuestionAppVue = new Vue({
        //被举报的问题
        el: "#readReportedQuestionApp",
        data() {
            return {
                ReportedQuestionList: [{
                    id: 0,
                    title: "",
                    content: "",
                    classification: "",
                    publishUserId: 0,
                    likeCount: 0,
                    reportStatus: 1,
                    reportIllegalReason: "",
                    checkStatus: 0,
                    checkIllegalReason: "",
                    launchTime: null,
                },],
            }
        },
        methods: {
            //查询分页后当前页面的数据
            showReportedQuestion() {
                var _this = this;
                //当页面加载完成后，发送异步请求，获取数据
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/question/showReportedQuestion",
                }).then(function (resp) {
                    if (resp.data.totalCount > 0) {
                        //设置前端数组数据
                        _this.ReportedQuestionList = resp.data.rows;
                        document.getElementById("afterLogin").style.display = "none";
                        document.getElementById("readReportedQuestionApp").style.display = "";
                    } else {
                        alert("你当前没有被举报的问题，请继续保持");
                    }
                })
            },
            returnMyMenu() {
                document.getElementById("afterLogin").style.display = "";
                document.getElementById("readReportedQuestionApp").style.display = "none";
            },
        },
    });
</script>

<script>
    var readMyGetMessageAppVue = new Vue({
        el: "#readMyGetMessageApp",
        data() {
            return {
                privateGetMessageList: [{
                    id: 0,
                    content: "",
                    fromUserId: 0,
                    toUserId: 0,
                    fromUserName: "",
                },],
                eachGetMessage: {
                    id: 0,
                    content: "",
                    fromUserId: 0,
                    toUserId: 0,
                    fromUserName: "",
                },
            }
        },
        methods: {
            //查询分页后当前页面的数据
            showMyGetMessage() {
                var _this = this;
                //当页面加载完成后，发送异步请求，获取数据
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/privateMessage/readMyGetMessage",
                }).then(function (resp) {
                    if (resp.data.totalCount > 0) {
                        //设置前端数组数据
                        _this.privateGetMessageList = resp.data.rows;
                    } else {
                        alert("你尚未收到其他用户的私信,请先返回首页哦");
                    }
                })
            },
            backApp() {
                document.getElementById("afterLogin").style.display = "";
                document.getElementById("readMyGetMessageApp").style.display = "none";
            },
            answerMessage(getMessageItem) {
                this.eachGetMessage = getMessageItem;
                if (this.eachGetMessage.id == 0) {
                    alert("当前没有人私信你，无需回复");
                } else {
                    document.getElementById("readMyGetMessageApp").style.display = "none";
                    document.getElementById("answerMessageApp").style.display = "";
                }
            }
        },
    });
</script>

<script>
    var answerCommentAppVue = new Vue({

        el: "#answerCommentApp",
        data() {
            return {
                answerComment: {
                    content: "",
                    answerCommentUserId: 0,
                    answerId: 0,
                    answerUserId: 0,
                    commentUserName: "",
                }
            }
        },

        methods: {
            sendAnswerComment() {
                this.answerComment.answerCommentUserId = afterLoginVue.$data.user.id;
                this.answerComment.commentUserName = afterLoginVue.$data.user.userName;
                this.answerComment.answerId = afterLoginVue.$data.eachAnswer.id;
                this.answerComment.answerUserId = afterLoginVue.$data.eachAnswer.answerUserId;

                var _this = this;
                //当页面加载完成后，发送异步请求，获取数据
                axios({
                    //method不能加s!!!!!!
                    method: "post",
                    url: "http://localhost:8080/demo01/answerComment/publishComment",
                    data: _this.answerComment,

                }).then(function (resp) {
                    alert(resp.data.result);
                    if (resp.data.status == 1) {
                        //对应不上！！！
                        //_this.answerComment=resp.data.t;

                        //清空输入框
                        _this.answerComment.content = "";
                        //刷新数据
                        afterLoginVue.showPost1();
                        document.getElementById("app").style.display = "none";
                        document.getElementById("loginApp").style.display = "none";
                        document.getElementById("registerApp").style.display = "none";
                        document.getElementById("afterLogin").style.display = "";
                        document.getElementById("forgetPasswordApp").style.display = "none";
                        document.getElementById("askQuestionApp").style.display = "none";
                        document.getElementById("answerCommentApp").style.display = "none";
                    }
                })
            },
            cancelComment() {
                //清空输入框
                this.answerComment.content = "";

                document.getElementById("app").style.display = "none";
                document.getElementById("loginApp").style.display = "none";
                document.getElementById("registerApp").style.display = "none";
                document.getElementById("forgetPasswordApp").style.display = "none";
                document.getElementById("askQuestionApp").style.display = "none";
                document.getElementById("afterLogin").style.display = "";
                document.getElementById("answerCommentApp").style.display = "none";
            }
        },
    });


</script>

<script>
    var askQuestionAppVue = new Vue({
        el: "#askQuestionApp",
        data() {
            return {
                question: {
                    title: "",
                    content: "",
                    classification: "",
                    publishUserId: 0,
                },
            }
        },

        methods: {
            commitQuestion() {

                var _this = this;

                //当页面加载完成后，发送异步请求，获取数据
                axios({

                    //method不能加s!!!!!!
                    method: "post",
                    url: "http://localhost:8080/demo01/question/askQuestion",
                    data: _this.question,

                }).then(function (resp) {

                    if (resp.data.status == 0) {
                        alert(resp.data.result);
                    } else {
                        alert(resp.data.result);
                        //对应不上！！！
                        //_this.question=resp.data.t;

                        //清空输入框
                        _this.question.content = "";
                        _this.question.title = "";
                        _this.question.classification = "";

                        //刷新数据
                        afterLoginVue.showPost1();
                        document.getElementById("app").style.display = "none";
                        document.getElementById("loginApp").style.display = "none";
                        document.getElementById("registerApp").style.display = "none";
                        document.getElementById("afterLogin").style.display = "";
                        document.getElementById("forgetPasswordApp").style.display = "none";
                        document.getElementById("askQuestionApp").style.display = "none";
                    }
                })
            },
            cancelAsk() {
                //清空输入框
                this.question.content = "";
                this.question.title = "";
                this.question.classification = "";

                document.getElementById("app").style.display = "none";
                document.getElementById("loginApp").style.display = "none";
                document.getElementById("registerApp").style.display = "none";
                document.getElementById("forgetPasswordApp").style.display = "none";
                document.getElementById("afterLogin").style.display = "";
                document.getElementById("askQuestionApp").style.display = "none";
            }
        },
    });
</script>

<script>
    var afterLoginVue = new Vue({
        el: "#afterLogin",
        mounted() {
            this.showPost1();
        },
        data() {
            return {
                eachQuestion: {
                    id: 1,
                    title: "问题无标题",
                    content: "问题无内容",
                    classification: "问题无分类",
                    publishUserId: 1,
                    likeCount: 0,
                    reportStatus: 1,
                    reportIllegalReason: "问题无举报原因",
                    checkStatus: 0,
                    checkIllegalReason: "问题未过审",
                    launchTime: null,
                },
                eachAnswer: {
                    id: 1,
                    answerUserId: 1,
                    content: "无内容",
                    questionId: 1,
                    answerUserName: "者为匿名",
                    questionUserId: 1
                },
                eachAnswerComment: {
                    id: 1,
                    content: "评论无内容",
                    answerCommentUserId: 1,
                    answerId: 1,
                    answerUserId: 1,
                    reportStatus: 1,
                    reportIllegalReason: "评论无举报原因",
                    commentUserName: "评论者为匿名",
                },

                allCount: 0,
                questionList: [{
                    id: 1,
                    title: "问题无标题",
                    content: "问题无内容",
                    classification: "问题无分类",
                    publishUserId: 1,
                    likeCount: 0,
                    reportStatus: 1,
                    reportIllegalReason: "问题无举报原因",
                    checkStatus: 0,
                    checkIllegalReason: "问题未过审",
                    launchTime: null,
                },],
                answerList: [{
                    id: 1,
                    answerUserId: 1,
                    content: "无内容",
                    questionId: 1,
                    answerUserName: "者为匿名",
                    questionUserId: 1
                },],
                answerCommentList: [{
                    id: 1,
                    content: "评论无内容",
                    answerCommentUserId: 1,
                    answerId: 1,
                    answerUserId: 1,
                    reportStatus: 1,
                    reportIllegalReason: "评论无举报原因",
                    commentUserName: "评论者为匿名",
                },],
                user: {
                    id: 0,
                    email: "primaryEmail",
                    password: "primaryPassword",
                    activationStatus: 1,
                    userName: "zkh",
                    gender: "男",
                    imagePath: "",
                    fansCount: 0,
                },
                pwd: "",
                myInterestedUser: "",
                myInterestedQuestion: "",

                // 当前页码
                currentPage: 1,
                //每页显示条数
                pageSize: 5,
            }
        },
        methods: {
            //查询分页后当前页面的数据
            showPost1() {
                var _this = this;
                //当页面加载完成后，发送异步请求，获取数据
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/user/selectByPage?currentPage=" + this.currentPage +
                        "&pageSize=" + this.pageSize,
                }).then(function (resp) {
                    //设置前端数组数据
                    _this.questionList = resp.data.questionList;
                    _this.answerList = resp.data.answerList;
                    _this.answerCommentList = resp.data.answerCommentList;
                    //设置问题总记录数
                    _this.allCount = resp.data.allCount;
                })
            },
            rankQuestionByLikesCount() {
                var _this = this;
                //当页面加载完成后，发送异步请求，获取数据
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/user/rankQuestionByLikesCount",
                }).then(function (resp) {
                    //设置前端数组数据
                    _this.questionList = resp.data.questionList;
                    _this.answerList = resp.data.answerList;
                    _this.answerCommentList = resp.data.answerCommentList;
                    //设置问题总记录数
                    _this.allCount = resp.data.allCount;
                })
            },
            comment(questionItem, answerItem) {
                this.eachQuestion = questionItem;
                this.eachAnswer = answerItem;
                document.getElementById("app").style.display = "none";
                document.getElementById("loginApp").style.display = "none";
                document.getElementById("registerApp").style.display = "none";
                document.getElementById("forgetPasswordApp").style.display = "none";
                document.getElementById("afterLogin").style.display = "none";
                document.getElementById("askQuestionApp").style.display = "none";
                document.getElementById("answerQuestionApp").style.display = "none";
                document.getElementById("answerCommentApp").style.display = "";
            },
            ReadyAnswer(questionItem) {
                this.eachQuestion = questionItem;
                document.getElementById("app").style.display = "none";
                document.getElementById("loginApp").style.display = "none";
                document.getElementById("registerApp").style.display = "none";
                document.getElementById("forgetPasswordApp").style.display = "none";
                document.getElementById("afterLogin").style.display = "none";
                document.getElementById("askQuestionApp").style.display = "none";
                document.getElementById("answerQuestionApp").style.display = "";
            },
            ReadySendMessage(questionItem) {
                this.eachQuestion = questionItem;
                document.getElementById("app").style.display = "none";
                document.getElementById("loginApp").style.display = "none";
                document.getElementById("registerApp").style.display = "none";
                document.getElementById("forgetPasswordApp").style.display = "none";
                document.getElementById("afterLogin").style.display = "none";
                document.getElementById("askQuestionApp").style.display = "none";
                document.getElementById("answerQuestionApp").style.display = "none";
                document.getElementById("sendMessageApp").style.display = "";
            },
            // addLike(questionItem) {
            //     questionItem.likeCount++;
            //     this.eachQuestion = questionItem;
            //     var _this = this;
            //     //当页面加载完成后，发送异步请求，获取数据
            //     axios({
            //         method: "post",
            //         //点赞
            //         url: "http://localhost:8080/demo01/question/thumpsUp",
            //         data: _this.eachQuestion,
            //     }).then(function (resp) {
            //         if (resp.data.status == 0) {
            //             //失败
            //             _this.eachQuestion.likeCount--;
            //             questionItem.likeCount--;
            //             alert(resp.data.result);
            //         } else if (resp.data.status == 1) {
            //             alert(resp.data.result);
            //             alert("当前问题点赞数：" + questionItem.likeCount);
            //         } else {
            //             alert("你没有权限点赞");
            //         }
            //     })
            // },
            addLike(questionItem) {
                this.eachQuestion = questionItem;
                var _this = this;
                //当页面加载完成后，发送异步请求，获取数据
                axios({
                    method: "post",
                    //点赞
                    url: "http://localhost:8080/demo01/question/thumpsUp",
                    data: _this.eachQuestion,
                }).then(function (resp) {
                    if (resp.data.status == 0) {
                        //失败
                        alert(resp.data.result);
                    } else if (resp.data.status == 1) {
                        alert(resp.data.result);
                        afterLoginVue.showPost1();
                    } else {
                        alert("你没有权限点赞");
                    }
                    afterLoginVue.showPost1();
                })
            },
            //收藏问题
            collectQuestion(questionItem) {
                this.eachQuestion = questionItem;
                var _this = this;
                //当页面加载完成后，发送异步请求，获取数据
                axios({
                    method: "post",
                    //点赞
                    url: "http://localhost:8080/demo01/collectQuestion/collectQuestion",
                    data: _this.eachQuestion,
                }).then(function (resp) {
                    alert(resp.data.result);
                })
            },

            searchUser() {
                var _this = this;
                //当页面加载完成后，发送异步请求，获取数据
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/user/searchUser?myInterestedUser=" + this.myInterestedUser,
                }).then(function (resp) {
                    if (resp.data.totalCount > 0) {
                        //设置前端数组数据
                        searchUsersAppVue.$data.searchUsers = resp.data.rows;
                        searchUsersAppVue.$data.hisQuestionList = afterLoginVue.$data.questionList;
                        document.getElementById("searchUsersApp").style.display = "";
                        document.getElementById("afterLogin").style.display = "none";
                    } else {
                        alert("搜索的用户不存在或输入框输入内容为空或者出现空格，请重试");
                    }
                })
            },

            searchQuestion() {
                var _this = this;
                //当页面加载完成后，发送异步请求，获取数据
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/question/searchQuestion?myInterestedQuestion=" + this.myInterestedQuestion,
                }).then(function (resp) {
                    if (resp.data.totalCount > 0) {
                        //设置前端数组数据
                        searchQuestionsAppVue.$data.searchQuestionList = resp.data.rows;
                        document.getElementById("searchQuestionsApp").style.display = "";
                        document.getElementById("afterLogin").style.display = "none";
                    } else {
                        alert("搜索的问题标题不存在或输入框输入内容为空或者出现空格，请重试");
                    }
                })
            },

            reportQuestion(questionItem) {
                this.eachQuestion = questionItem;
                document.getElementById("reportQuestionApp").style.display = "";
                document.getElementById("afterLogin").style.display = "none";
            },
            reportComment(answerCommentItem) {
                this.eachAnswerComment = answerCommentItem;
                document.getElementById("reportCommentApp").style.display = "";
                document.getElementById("afterLogin").style.display = "none";
            },
            editPersonalInformation() {
                editProfileAppVue.$data.originPassword = "";
                editProfileAppVue.showUser();
                document.getElementById("afterLogin").style.display = "none";
                document.getElementById("editProfileApp").style.display = "";
            },

            //分页
            handleSizeChange(val) {
                console.log(`每页 ${val} 条`);
                //重新设置每页显示条数
                this.pageSize = val;
                //刷新页面
                this.showPost1()
            },
            handleCurrentChange(val) {
                console.log(`当前页: ${val}`);
                //重新设置当前页码
                this.currentPage = val;
                //刷新页面
                this.showPost1();
            }

        },
    });
    document.getElementById("askQuestion").onclick = function () {
        document.getElementById("app").style.display = "none";
        document.getElementById("loginApp").style.display = "none";
        document.getElementById("registerApp").style.display = "none";
        document.getElementById("forgetPasswordApp").style.display = "none";
        document.getElementById("afterLogin").style.display = "none";
        document.getElementById("askQuestionApp").style.display = "";
    };

    document.getElementById("seeMySendMessage").onclick = function () {
        readMySendMessageAppVue.showMySendMessage();
        document.getElementById("app").style.display = "none";
        document.getElementById("loginApp").style.display = "none";
        document.getElementById("registerApp").style.display = "none";
        document.getElementById("forgetPasswordApp").style.display = "none";
        document.getElementById("afterLogin").style.display = "none";
        document.getElementById("askQuestionApp").style.display = "none";
        document.getElementById("readMySendMessageApp").style.display = "";
    };
    document.getElementById("seeMyGetMessage").onclick = function () {
        readMyGetMessageAppVue.showMyGetMessage();
        document.getElementById("afterLogin").style.display = "none";
        document.getElementById("readMyGetMessageApp").style.display = "";
    };
    document.getElementById("editImage").onclick = function () {
        document.getElementById("afterLogin").style.display = "none";
        document.getElementById("editImageApp").style.display = "";
    };

    document.getElementById("deFriends").onclick = function () {
        deFriendAppVue.listOtherUsers();
        document.getElementById("afterLogin").style.display = "none";
        document.getElementById("deFriendApp").style.display = "";
    };
    document.getElementById("seeMyDeFriend").onclick = function () {
        readMyDeFriendAppVue.listBlackUsers();
    };

    document.getElementById("seeNotPassQuestion").onclick = function () {
        readNotPassQuestionAppVue.showNotPassQuestion();
    };

    document.getElementById("seeReportedQuestion").onclick = function () {
        readReportedQuestionAppVue.showReportedQuestion();
    };
    document.getElementById("seePursuingUsers").onclick = function () {
        pursueUsersAppVue.listPursuingUsers();
    };
    document.getElementById("seePursuedUsers").onclick = function () {
        myPursueUsersAppVue.listMyPursueUsers();
    };

    document.getElementById("seeMyPursueUserQuestion").onclick = function () {
        readMyPursueUserQuestionVue.showMyPursueUserQuestions();
    };

    document.getElementById("seePursuedHotTopics").onclick = function () {
        readMyPursueTopicQuestionVue.showMyPursueTopicQuestions();
    };
    document.getElementById("seeNotPursuedTopics").onclick = function () {
        showNotPursueTopicsAppVue.showNotPursueTopics();
    };
    document.getElementById("seePursuedTopics").onclick = function () {
        showPursueTopicsAppVue.showPursueTopics();
    };
    document.getElementById("seeMyCollectQuestion").onclick = function () {
        readMyCollectQuestionsVue.showMyCollectQuestions();
    };

    document.getElementById("updatePasswordButton").onclick = function () {
        document.getElementById("afterLogin").style.display = "none";
        document.getElementById("updatePasswordApp").style.display = "";
    };


</script>

<script>
    var afterAdministratorLoginAppVue = new Vue({
        el: "#afterAdministratorLoginApp",
    });

    document.getElementById("seeUncheckedQuestion").onclick = function () {
        checkWaitingQuestionAppVue.listUncheckedQuestions();
    };

    document.getElementById("seeQuestionsReported").onclick = function () {
        checkReportedQuestionAppVue.listReportedQuestions();
    };

    document.getElementById("seeReportedComment").onclick = function () {
        checkReportedCommentAppVue.listReportedComments();
    };
    document.getElementById("setUserPermission").onclick = function () {
        setUserPrivilegeVue.listUserPrivileges();
    };

    document.getElementById("BanUserButton").onclick = function () {
        banUserAppVue.listUsers();
    };

</script>

<script>

    var loginAppVue = new Vue({
        el: "#loginApp",
        data() {
            return {
                user1: {
                    email: "2064272436@qq.com",
                    password: "123Aa!",
                    checkCode: "",
                },
            }
        },
        methods: {
            login() {

                console.log(this.user1.password);
                console.log(this.user1);
                var that = this;

                //当页面加载完成后，发送异步请求，获取数据
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/user/login?email=" + that.user1.email + "&password="
                        + that.user1.password + "&checkCode=" + that.user1.checkCode,
                }).then(function (resp) {

                    if (resp.data.status == 0) {
                        alert(resp.data.result);
                    } else {
                        that.user = resp.data.t;
                        //未确定的修改
                        afterLoginVue.$data.user = resp.data.t;

                        editImageAppVue.$data.editImagePath = afterLoginVue.$data.user.imagePath;

                        editProfileAppVue.$data.editUser = resp.data.t;
                        afterLoginVue.$data.pwd = that.user.password;

                        alert(resp.data.result);

                        afterLoginVue.showPost1();

                        document.getElementById("afterLogin").style.display = "";
                        document.getElementById("loginApp").style.display = "none";
                        document.getElementById("forgetPasswordApp").style.display = "none";
                        document.getElementById("registerApp").style.display = "none";
                        document.getElementById("app").style.display = "none";
                        document.getElementById("askQuestionApp").style.display = "none";

                    }
                })
            },
            updateCheckCode() {
                document.getElementById("imageChange").onclick = function () {
                    document.getElementById("checkCodeImage").src = "http://localhost:8080/demo01/checkCodeServlet?" + new Date().getMilliseconds() + "1";

                }
            }
        },
    });

    document.getElementById("forgetPassword").onclick = function () {
        document.getElementById("afterLogin").style.display = "none";
        document.getElementById("app").style.display = "none";
        document.getElementById("loginApp").style.display = "none";
        document.getElementById("registerApp").style.display = "none";
        document.getElementById("askQuestionApp").style.display = "none";
        document.getElementById("forgetPasswordApp").style.display = "";
    }
    document.getElementById("comeApp").onclick = function () {
        document.getElementById("app").style.display = "";
        document.getElementById("loginApp").style.display = "none";
    }
</script>

<script>

    var registerAppVue = new Vue({
        el: "#registerApp",
        data() {
            return {
                user2: {
                    email: "1@qq.com",
                    password: "123Aa!",
                    checkCode2: "1",
                },
            }
        },
        methods: {
            register() {
                var that = this;
                //当页面加载完成后，发送异步请求，获取数据
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/user/register?email=" + that.user2.email + "&password="
                        + that.user2.password + "&checkCode2=" + that.user2.checkCode2,
                }).then(function (resp) {
                    if (resp.data.status == 0) {
                        alert(resp.data.result);
                    } else {
                        //不确定修改
                        afterLoginVue.$data.user = resp.data.t;

                        editImageAppVue.$data.editImagePath = afterLoginVue.$data.user.imagePath;

                        editProfileAppVue.$data.editUser = resp.data.t;
                        that.user = resp.data.t;
                        console.log(that.user);

                        alert(that.user.email);
                        alert(resp.data.result);

                        document.getElementById("afterLogin").style.display = "";
                        document.getElementById("loginApp").style.display = "none";
                        document.getElementById("registerApp").style.display = "none";
                        document.getElementById("app").style.display = "none";
                        document.getElementById("forgetPasswordApp").style.display = "none";
                        document.getElementById("askQuestionApp").style.display = "none";
                    }
                })
            },
            updateCheckCode1() {
                document.getElementById("imageChange1").onclick = function () {
                    document.getElementById("checkCodeImage1").src = "http://localhost:8080/demo01/checkCodeServlet?" + new Date().getMilliseconds();
                }
            }
        },
    });
</script>

<script>
    new Vue({
        el: "#forgetPasswordApp",
        data() {
            return {
                user3: {
                    email: "@qq.com",
                    password: "123",
                    emailCheckCode: "",
                },
            }
        },
        methods: {
            sendEmailCode() {
                //当页面加载完成后，发送异步请求，获取数据
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/user/sendEmailCode",
                }).then(function (resp) {
                    if (resp.data.status == 1) {
                        alert(resp.data.result);
                    } else {
                        alert("发送邮箱验证码出问题了");
                    }
                })
            },
            forgetPassword() {
                var that = this;
                //当页面加载完成后，发送异步请求，获取数据
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/user/forgetPassword?email=" + that.user3.email + "&password="
                        + that.user3.password + "&emailCheckCode=" + that.user3.emailCheckCode,
                }).then(function (resp) {
                    if (resp.data.status == 0) {
                        alert(resp.data.result);
                    } else {
                        alert(resp.data.result);
                        //不确定修改
                        afterLoginVue.$data.user = resp.data.t;
                        editProfileAppVue.$data.editUser = resp.data.t;
                        //??
                        // editImageAppVue.$data.editImagePath = resp.data.t.imagePath;
                        editImageAppVue.$data.editImagePath = afterLoginVue.$data.user.imagePath;

                        that.user = resp.data.t;
                        console.log(that.user);
                        alert("新密码:" + that.user.password);
                        afterLoginVue.showPost1();

                        document.getElementById("afterLogin").style.display = "";
                        document.getElementById("loginApp").style.display = "none";
                        document.getElementById("registerApp").style.display = "none";
                        document.getElementById("app").style.display = "none";
                        document.getElementById("forgetPasswordApp").style.display = "none";
                        document.getElementById("askQuestionApp").style.display = "none";
                    }
                })
            },
        },
    });
</script>

<script>
    var answerQuestionAppVue = new Vue({
        el: "#answerQuestionApp",
        data() {
            return {
                answer: {
                    answerUserId: 0,
                    content: "",
                    questionId: 0,
                    answerUserName: "",
                    questionUserId: 0,
                },
            }
        },
        methods: {
            cancelAnswer() {
                //清空输入框
                this.answer.content = "";

                document.getElementById("afterLogin").style.display = "";
                document.getElementById("loginApp").style.display = "none";
                document.getElementById("registerApp").style.display = "none";
                document.getElementById("app").style.display = "none";
                document.getElementById("forgetPasswordApp").style.display = "none";
                document.getElementById("askQuestionApp").style.display = "none";
                document.getElementById("answerQuestionApp").style.display = "none";
            },

            sendAnswer() {
                //afterLoginVue.$data.user.id  只能拿到初始化的值，无法动态变化
                // this.questionId = afterLoginVue.$data.eachQuestion.id;
                // this.questionUserId = afterLoginVue.$data.eachQuestion.publishUserId;
                var _this = this;

                this.answer.questionId = afterLoginVue.$data.eachQuestion.id;
                this.answer.questionUserId = afterLoginVue.$data.eachQuestion.publishUserId;
                this.answer.answerUserName = afterLoginVue.$data.user.userName;
                this.answer.answerUserId = afterLoginVue.$data.user.id;

                // 当页面加载完成后，发送异步请求，获取数据
                axios({
                    // method: "get",
                    // //变量命名得改一下！！太多重复了，命名重复的要加上自定义对象名字
                    // url: "http://localhost:8080/demo01/answer/answerQuestion?questionId="
                    //     + this.questionId + "&questionUserId=" + this.questionUserId + "&content=" + this.answer.content,
                    method: "post",
                    url: "http://localhost:8080/demo01/answer/answerQuestion",
                    data: this.answer,
                }).then(function (resp) {

                    alert(resp.data.result);

                    if (resp.data.status == 1) {
                        //清空输入框
                        _this.answer.content = "";

                        afterLoginVue.showPost1();

                        document.getElementById("afterLogin").style.display = "";
                        document.getElementById("loginApp").style.display = "none";
                        document.getElementById("registerApp").style.display = "none";
                        document.getElementById("app").style.display = "none";
                        document.getElementById("forgetPasswordApp").style.display = "none";
                        document.getElementById("askQuestionApp").style.display = "none";
                        document.getElementById("answerQuestionApp").style.display = "none";
                    }
                })
            },
        },
    });
</script>

<script>
    var answerMessageAppVue = new Vue({
        el: "#answerMessageApp",
        data() {
            return {
                answerPrivateMessage: {
                    content: "",
                    fromUserId: 0,
                    toUserId: 0,
                    fromUserName: "",
                }
            }
        },
        methods: {
            //查询分页后当前页面的数据
            sendAnswerMessage() {
                var _this = this;
                //封装数据
                this.answerPrivateMessage.toUserId = readMyGetMessageAppVue.$data.eachGetMessage.fromUserId;
                this.answerPrivateMessage.fromUserName = afterLoginVue.$data.user.userName;
                this.answerPrivateMessage.fromUserId = afterLoginVue.$data.user.id;

                //当页面加载完成后，发送异步请求，获取数据
                axios({
                    method: "post",
                    url: "http://localhost:8080/demo01/privateMessage/sendMessage",
                    data: _this.answerPrivateMessage,
                }).then(function (resp) {

                    alert(resp.data.result);

                    if (resp.data.status == 1) {
                        //清空输入框
                        _this.answerPrivateMessage.content = "";

                        //刷新数据，防止自己发给自己时出bug
                        readMyGetMessageAppVue.showMyGetMessage();

                        document.getElementById("readMyGetMessageApp").style.display = "";
                        document.getElementById("answerMessageApp").style.display = "none";

                    }
                })
            },

            //取消回复私信
            cancelSendAnswerMessage() {
                //清空输入框
                this.answerPrivateMessage.content = "";

                document.getElementById("readMyGetMessageApp").style.display = "";
                document.getElementById("answerMessageApp").style.display = "none";
            },
        },
    });
</script>

<script>
    var sendMessageAppVue = new Vue({
        el: "#sendMessageApp",
        data() {
            return {
                privateMessage: {
                    content: "",
                    fromUserId: 0,
                    toUserId: 0,
                    fromUserName: "",
                },
            }
        },
        methods: {
            cancelSendMessage() {
                //清空输入框
                this.privateMessage.content = "";

                document.getElementById("afterLogin").style.display = "";
                document.getElementById("loginApp").style.display = "none";
                document.getElementById("registerApp").style.display = "none";
                document.getElementById("app").style.display = "none";
                document.getElementById("forgetPasswordApp").style.display = "none";
                document.getElementById("askQuestionApp").style.display = "none";
                document.getElementById("answerQuestionApp").style.display = "none";
                document.getElementById("sendMessageApp").style.display = "none";
            },

            sendMessage() {
                //afterLoginVue.$data.user.id  只能拿到初始化的值，无法动态变化
                // this.questionId = afterLoginVue.$data.eachQuestion.id;
                // this.questionUserId = afterLoginVue.$data.eachQuestion.publishUserId;
                var _this = this;

                this.privateMessage.toUserId = afterLoginVue.$data.eachQuestion.publishUserId;
                this.privateMessage.fromUserName = afterLoginVue.$data.user.userName;
                this.privateMessage.fromUserId = afterLoginVue.$data.user.id;

                // 当页面加载完成后，发送异步请求，获取数据
                axios({
                    // //变量命名得改一下！！太多重复了，命名重复的要加上自定义对象名字
                    method: "post",
                    url: "http://localhost:8080/demo01/privateMessage/sendMessage",
                    data: this.privateMessage,
                }).then(function (resp) {

                    alert(resp.data.result);

                    if (resp.data.status == 1) {

                        //清空输入框
                        _this.privateMessage.content = "";

                        document.getElementById("afterLogin").style.display = "";
                        document.getElementById("loginApp").style.display = "none";
                        document.getElementById("registerApp").style.display = "none";
                        document.getElementById("app").style.display = "none";
                        document.getElementById("forgetPasswordApp").style.display = "none";
                        document.getElementById("askQuestionApp").style.display = "none";
                        document.getElementById("answerQuestionApp").style.display = "none";
                        document.getElementById("sendMessageApp").style.display = "none";
                    }
                })
            },
        },
    });
</script>

<script>
    var reportQuestionAppVue = new Vue({
        el: "#reportQuestionApp",
        data() {
            return {
                reportQuestionId: 0,
                reportQuestionReason: "",
            }
        },
        methods: {
            cancelReportQuestion() {
                //清空输入框
                this.reportQuestionReason = "";
                document.getElementById("afterLogin").style.display = "";
                document.getElementById("reportQuestionApp").style.display = "none";
            },
            sendReportQuestion() {
                //afterLoginVue.$data.user.id  只能拿到初始化的值，无法动态变化
                // this.questionId = afterLoginVue.$data.eachQuestion.id;
                // this.questionUserId = afterLoginVue.$data.eachQuestion.publishUserId;
                var _this = this;

                this.reportQuestionId = afterLoginVue.$data.eachQuestion.id;

                // 当页面加载完成后，发送异步请求，获取数据
                axios({
                    // //变量命名得改一下！！太多重复了，命名重复的要加上自定义对象名字
                    methods: "get",
                    url: "http://localhost:8080/demo01/question/reportQuestion?reportQuestionId=" + this.reportQuestionId
                        + "&reportQuestionReason=" + this.reportQuestionReason,
                }).then(function (resp) {
                    if (resp.data.status == 0) {
                        alert(resp.data.result);
                    } else {
                        alert(resp.data.result);
                        afterLoginVue.showPost1();
                        //清空输入框
                        _this.reportQuestionReason = "";
                        document.getElementById("afterLogin").style.display = "";
                        document.getElementById("reportQuestionApp").style.display = "none";

                    }
                })
            },
        },
    });
</script>

<script>
    var rejectPublishQuestionAppVue = new Vue({
        el: "#rejectPublishQuestionApp",
        data() {
            return {
                rejectQuestionId: 0,
                rejectPublishQuestionReason: "",
            }
        },
        methods: {
            cancelRejectQuestion() {
                //清空输入框
                this.rejectPublishQuestionReason = "";
                document.getElementById("checkWaitingQuestionApp").style.display = "";
                document.getElementById("rejectPublishQuestionApp").style.display = "none";
            },
            sendRejectQuestion() {
                var _this = this;

                this.rejectQuestionId = checkWaitingQuestionAppVue.$data.eachUncheckedQuestion.id;

                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/question/sendRejectQuestion?rejectQuestionId=" + this.rejectQuestionId
                        + "&rejectPublishQuestionReason=" + this.rejectPublishQuestionReason,
                }).then(function (resp) {
                    alert(resp.data.result);
                    if (resp.data.status == 1) {
                        checkWaitingQuestionAppVue.listUncheckedQuestions();
                        //清空输入框
                        _this.rejectPublishQuestionReason = "";
                        document.getElementById("checkWaitingQuestionApp").style.display = "";
                        document.getElementById("rejectPublishQuestionApp").style.display = "none";

                    }
                })
            },
        },
    });


</script>

<script>
    var reportCommentAppVue = new Vue({
        el: "#reportCommentApp",
        data() {
            return {
                reportCommentId: 0,
                reportCommentReason: "",
            }
        },
        methods: {
            cancelReportComment() {
                //清空输入框
                this.reportCommentReason = "";
                document.getElementById("afterLogin").style.display = "";
                document.getElementById("reportCommentApp").style.display = "none";
            },
            sendReportComment() {
                //afterLoginVue.$data.user.id  只能拿到初始化的值，无法动态变化
                // this.questionId = afterLoginVue.$data.eachQuestion.id;
                // this.questionUserId = afterLoginVue.$data.eachQuestion.publishUserId;
                var _this = this;

                this.reportCommentId = afterLoginVue.$data.eachAnswerComment.id;

                // 当页面加载完成后，发送异步请求，获取数据
                axios({
                    // //变量命名得改一下！！太多重复了，命名重复的要加上自定义对象名字
                    methods: "get",
                    url: "http://localhost:8080/demo01/answerComment/reportComment?reportCommentId=" + this.reportCommentId
                        + "&reportCommentReason=" + this.reportCommentReason,
                }).then(function (resp) {
                    if (resp.data.status == 0) {
                        alert(resp.data.result);
                    } else {
                        alert(resp.data.result);
                        afterLoginVue.showPost1();
                        //清空输入框
                        _this.reportCommentReason = "";
                        document.getElementById("afterLogin").style.display = "";
                        document.getElementById("reportCommentApp").style.display = "none";
                    }
                })
            },
        },
    });
</script>

<script>
    var editProfileAppVue = new Vue({
        el: "#editProfileApp",
        data() {
            return {
                editUser: {
                    id: 0,
                    email: "",
                    password: "",
                    activationStatus: 1,
                    userName: "",
                    gender: "",
                    imagePath: "",
                    fansCount: 0,
                },
                originPassword: "",
            }
        },
        methods: {
            showUser() {
                axios({
                    method: "get",
                    url: "http://localhost:8080/demo01/user/showUser",
                }).then(function (resp) {
                    if (resp.data.status == 0) {
                        alert(resp.data.result);
                    } else {
                        afterLoginVue.$data.user = resp.data.t;
                        //必须是editProfileAppVue.$data.editUser，不能是this.editUser，两者代表不一样，
                        // 其次， this.editUser = resp.data.t不能省略，否则会报错
                        editProfileAppVue.$data.editUser = resp.data.t;
                        this.editUser = resp.data.t;
                    }
                })
            },

            cancelEditProfile() {
                this.originPassword = "";
                this.showUser();
                document.getElementById("afterLogin").style.display = "";
                document.getElementById("editProfileApp").style.display = "none";
            },

            sendEditProfile() {
                var _this = this;
                if (this.originPassword != this.editUser.password) {
                    //清空输入框
                    this.originPassword = "";
                    alert("原密码校验错误导致信息修改失败，请重新尝试校验");
                    this.showUser();
                    document.getElementById("afterLogin").style.display = "";
                    document.getElementById("editProfileApp").style.display = "none";
                    return;
                }
                axios({
                    method: "post",
                    url: "http://localhost:8080/demo01/user/editProfile",
                    data: this.editUser,
                }).then(function (resp) {
                    if (resp.data.status == 0) {
                        alert(resp.data.result);
                        //恢复数据
                        _this.showUser();
                    } else {
                        alert(resp.data.result);
                        //刷新数据
                        _this.showUser();
                    }
                })
            },
        },
    });
</script>

<script>
    var updatePasswordAppVue = new Vue({
        el: "#updatePasswordApp",
        data() {
            return {
                newPassword: "",
                oldPassword: "",
            }
        },
        methods: {
            updatePassword() {
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/user/updatePassword?oldPassword="
                        + this.oldPassword + "&newPassword=" + this.newPassword,
                }).then(function (resp) {
                    alert(resp.data.result);
                    if (resp.data.status == 1) {
                        afterLoginVue.$data.user = resp.data.t;
                        //必须是editProfileAppVue.$data.editUser，不能是this.editUser，两者代表不一样，
                        // 其次， this.editUser = resp.data.t不能省略，否则会报错
                        editProfileAppVue.$data.editUser = resp.data.t;
                        this.oldpassword = "";
                        this.newPassword = "";

                    }
                })
            },

            cancelUpdatePassword() {
                this.oldPassword = "";
                this.newPassword = "";
                document.getElementById("afterLogin").style.display = "";
                document.getElementById("updatePasswordApp").style.display = "none";
            },
        },
    });
</script>

<script>
    var deFriendAppVue = new Vue({
        el: "#deFriendApp",
        data() {
            return {
                userList: [{
                    id: 0,
                    email: "",
                    password: "",
                    activationStatus: 1,
                    userName: "",
                    gender: "",
                    imagePath: "http://localhost:8080/demo01/uploads/0.jpg",
                    fansCount: 0,
                },],
                deFriendId: 0,
            }
        },
        methods: {
            listOtherUsers() {
                var _this = this;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/blackList/listOtherUsers",
                }).then(function (resp) {
                    if (resp.data.totalCount == 0) {
                        alert("当前系统只剩下你一个用户了");
                        document.getElementById("afterLogin").style.display = "";
                        document.getElementById("deFriendApp").style.display = "none";
                    } else {
                        _this.userList = resp.data.rows;
                        deFriendAppVue.$data.userList = resp.data.rows;
                    }
                })
            },

            deFriend(eachUser) {
                var _this = this;
                this.deFriendId = eachUser.id;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/blackList/deFriend?deFriendId=" + this.deFriendId,
                }).then(function (resp) {
                    if (resp.data.status == 0) {
                        alert(resp.data.result);
                    } else {
                        //刷新
                        _this.listOtherUsers();
                        alert(resp.data.result);
                    }
                })
            },

            comBackApp() {
                document.getElementById("afterLogin").style.display = "";
                document.getElementById("deFriendApp").style.display = "none";
            },
        },
    });
</script>

<script>
    var pursueUsersAppVue = new Vue({
        el: "#pursueUsersApp",
        data() {
            return {
                pursuingUsers: [{
                    id: 0,
                    email: "",
                    password: "",
                    activationStatus: 1,
                    userName: "",
                    gender: "",
                    imagePath: "http://localhost:8080/demo01/uploads/0.jpg",
                    fansCount: 0,
                },],
                pursueUserId: 0,
            }
        },
        methods: {
            listPursuingUsers() {
                var _this = this;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/pursueList/listPursuingUsers",
                }).then(function (resp) {
                    if (resp.data.totalCount == 0) {
                        alert("当前系统只剩下你一个用户了");
                        document.getElementById("afterLogin").style.display = "";
                        document.getElementById("pursueUsersApp").style.display = "none";
                    } else {
                        _this.pursuingUsers = resp.data.rows;
                        pursueUsersAppVue.$data.pursuingUsers = resp.data.rows;
                        document.getElementById("afterLogin").style.display = "none";
                        document.getElementById("pursueUsersApp").style.display = "";
                    }
                })
            },

            pursueUser(pursuingUser) {
                var _this = this;
                this.pursueUserId = pursuingUser.id;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/pursueList/pursueUser?pursueUserId=" + this.pursueUserId,
                }).then(function (resp) {
                    alert(resp.data.result);
                    if (resp.data.status == 1) {
                        //刷新
                        _this.listPursuingUsers();
                    }
                })
            },

            moveBackApp() {
                document.getElementById("afterLogin").style.display = "";
                document.getElementById("pursueUsersApp").style.display = "none";
            },
        },
    });
</script>

<script>
    var myPursueUsersAppVue = new Vue({
        el: "#myPursueUsersApp",
        data() {
            return {
                pursuedUsers: [{
                    id: 0,
                    email: "",
                    password: "",
                    activationStatus: 1,
                    userName: "",
                    gender: "",
                    imagePath: "http://localhost:8080/demo01/uploads/0.jpg",
                    fansCount: 0,
                },],
                cancelPursueUserId: 0,
            }
        },
        methods: {
            listMyPursueUsers() {
                var _this = this;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/pursueList/listMyPursueUsers",
                }).then(function (resp) {
                    if (resp.data.totalCount == 0) {
                        alert("你还没有关注过用户哦");
                        document.getElementById("afterLogin").style.display = "";
                        document.getElementById("myPursueUsersApp").style.display = "none";
                    } else {
                        _this.pursuedUsers = resp.data.rows;
                        myPursueUsersAppVue.$data.pursuedUsers = resp.data.rows;
                        document.getElementById("afterLogin").style.display = "none";
                        document.getElementById("myPursueUsersApp").style.display = "";
                    }
                })
            },

            cancelPursueUser(pursuedUser) {
                var _this = this;
                this.cancelPursueUserId = pursuedUser.id;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/pursueList/cancelPursueUser?cancelPursueUserId="
                        + this.cancelPursueUserId,
                }).then(function (resp) {
                    alert(resp.data.result);
                    if (resp.data.status == 1) {
                        //刷新
                        _this.listMyPursueUsers();
                    }
                })
            },

            moveApp() {
                document.getElementById("afterLogin").style.display = "";
                document.getElementById("myPursueUsersApp").style.display = "none";
            },
            seeOurCommonPursueUsers(pursuedUser) {
                commonPursueUsersAppVue.$data.eachPursueUserId = pursuedUser.id;
                commonPursueUsersAppVue.listCommonPursueUsers();
            },
        },
    });

</script>

<script>
    var commonPursueUsersAppVue = new Vue({
        el: "#commonPursueUsersApp",
        data() {
            return {
                commonPursueUsers: [{
                    id: 0,
                    email: "",
                    password: "",
                    activationStatus: 1,
                    userName: "",
                    gender: "",
                    imagePath: "http://localhost:8080/demo01/uploads/0.jpg",
                    fansCount: 0,
                },],
                eachPursueUserId: 0,
            }
        },
        methods: {
            listCommonPursueUsers() {
                var _this = this;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/pursueList/listCommonPursueUsers?eachPursueUserId=" + this.eachPursueUserId,
                }).then(function (resp) {
                    if (resp.data.totalCount == 0) {
                        alert("你们没有共同关注的好友哦");
                        document.getElementById("myPursueUsersApp").style.display = "";
                        document.getElementById("commonPursueUsersApp").style.display = "none";
                    } else {
                        _this.commonPursueUsers = resp.data.rows;
                        commonPursueUsersAppVue.$data.commonPursueUsers = resp.data.rows;
                        document.getElementById("myPursueUsersApp").style.display = "none";
                        document.getElementById("commonPursueUsersApp").style.display = "";
                    }
                })
            },

            returnBackApp() {
                document.getElementById("myPursueUsersApp").style.display = "";
                document.getElementById("commonPursueUsersApp").style.display = "none";
            },
        },
    });
</script>

<script>
    var searchUsersAppVue = new Vue({
        el: "#searchUsersApp",
        data() {
            return {
                searchUsers: [{
                    id: 0,
                    email: "",
                    password: "",
                    activationStatus: 1,
                    userName: "",
                    gender: "",
                    imagePath: "http://localhost:8080/demo01/uploads/0.jpg",
                    fansCount: 0,
                },],
                hisQuestionList: [{
                    id: 0,
                    title: "",
                    content: "",
                    classification: "",
                    publishUserId: 0,
                    likeCount: 0,
                    reportStatus: 1,
                    reportIllegalReason: "",
                    checkStatus: 0,
                    checkIllegalReason: "",
                    launchTime: null,
                }],
            }
        },
        methods: {
            quitSearch() {
                document.getElementById("afterLogin").style.display = "";
                document.getElementById("searchUsersApp").style.display = "none";
            },
        },
    });
</script>

<script>
    var searchQuestionsAppVue = new Vue({
        el: "#searchQuestionsApp",
        data() {
            return {
                searchQuestionList: [{
                    id: 0,
                    title: "",
                    content: "",
                    classification: "",
                    publishUserId: 0,
                    likeCount: 0,
                    reportStatus: 1,
                    reportIllegalReason: "",
                    checkStatus: 0,
                    checkIllegalReason: "",
                    launchTime: null,
                }],
            }
        },
        methods: {
            quitSearchQuestion() {
                document.getElementById("afterLogin").style.display = "";
                document.getElementById("searchQuestionsApp").style.display = "none";
            },
        },
    });
</script>

<script>
    var banUserAppVue = new Vue({
        el: "#banUserApp",
        data() {
            return {
                users: [{
                    id: 0,
                    email: "",
                    password: "",
                    activationStatus: 1,
                    userName: "",
                    gender: "",
                    imagePath: "http://localhost:8080/demo01/uploads/0.jpg",
                    fansCount: 0,
                },],
                banUserId: 0,
                cancelBanUserId: 0,
            }
        },
        methods: {
            listUsers() {
                var _this = this;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/user/listUsers",
                }).then(function (resp) {
                    if (resp.data.totalCount == 0) {
                        alert("当前系统没有用户了");
                        document.getElementById("afterAdministratorLoginApp").style.display = "";
                        document.getElementById("banUserApp").style.display = "none";
                    } else {
                        _this.users = resp.data.rows;
                        banUserAppVue.$data.users = resp.data.rows;
                        document.getElementById("afterAdministratorLoginApp").style.display = "none";
                        document.getElementById("banUserApp").style.display = "";
                    }
                })
            },

            banUser(eachUser) {
                var _this = this;
                this.banUserId = eachUser.id;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/user/banUser?banUserId=" + this.banUserId,
                }).then(function (resp) {
                    alert(resp.data.result);
                    if (resp.data.status == 1) {
                        //刷新
                        _this.listUsers();
                    }
                })
            },

            cancelBanUser(eachUser) {
                var _this = this;
                this.cancelBanUserId = eachUser.id;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/user/cancelBanUser?cancelBanUserId=" + this.cancelBanUserId,
                }).then(function (resp) {
                    alert(resp.data.result);
                    if (resp.data.status == 1) {
                        //刷新
                        _this.listUsers();
                    }
                })
            },

            leave() {
                document.getElementById("afterAdministratorLoginApp").style.display = "";
                document.getElementById("banUserApp").style.display = "none";
            },
        },
    });
</script>

<script>
    var readMyDeFriendAppVue = new Vue({
        el: "#readMyDeFriendApp",
        data() {
            return {
                BlackUserList: [{
                    id: 0,
                    email: "",
                    password: "",
                    activationStatus: 1,
                    userName: "",
                    gender: "",
                    imagePath: "http://localhost:8080/demo01/uploads/0.jpg",
                    fansCount: 0,
                },],
                cancelDeFriendId: 0,
            }
        },
        methods: {
            listBlackUsers() {
                var _this = this;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/blackList/listBlackUsers",
                }).then(function (resp) {
                    if (resp.data.totalCount == 0) {
                        alert("您尚未拉黑过用户，黑名单为空");
                        document.getElementById("readMyDeFriendApp").style.display = "none";
                        document.getElementById("afterLogin").style.display = "";
                    } else {
                        _this.BlackUserList = resp.data.rows;
                        readMyDeFriendAppVue.$data.BlackUserList = resp.data.rows;
                        document.getElementById("afterLogin").style.display = "none";
                        document.getElementById("readMyDeFriendApp").style.display = "";
                    }
                })
            },

            cancelDeFriend(eachBlackUser) {
                var _this = this;
                this.cancelDeFriendId = eachBlackUser.id;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/blackList/cancelDeFriend?cancelDeFriendId=" + this.cancelDeFriendId,
                }).then(function (resp) {
                    if (resp.data.status == 0) {
                        alert(resp.data.result);
                    } else {
                        //刷新
                        alert(resp.data.result);
                        _this.listBlackUsers();
                    }
                })
            },

            comBackMenu() {
                document.getElementById("afterLogin").style.display = "";
                document.getElementById("readMyDeFriendApp").style.display = "none";
            },
        },
    });
</script>

<script>
    var readMyPursueUserQuestionVue = new Vue({
        el: "#readMyPursueUserQuestion",
        data() {
            return {
                myPursueUserQuestions: [{
                    id: 1,
                    title: "问题无标题",
                    content: "问题无内容",
                    classification: "问题无分类",
                    publishUserId: 1,
                    likeCount: 0,
                    reportStatus: 1,
                    reportIllegalReason: "问题无举报原因",
                    checkStatus: 0,
                    checkIllegalReason: "问题未过审",
                    launchTime: null,
                },],
            }
        },
        methods: {
            showMyPursueUserQuestions() {
                var _this = this;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/pursueList/showMyPursueUserQuestions",
                }).then(function (resp) {

                    if (resp.data.totalCount == 0) {
                        alert("你关注的用户，他们尚未发布过问题");
                        document.getElementById("readMyPursueUserQuestion").style.display = "none";
                        document.getElementById("afterLogin").style.display = "";
                    } else if (resp.data.totalCount == -1) {
                        alert("你还没有关注过用户，请先关注");
                        document.getElementById("readMyPursueUserQuestion").style.display = "none";
                        document.getElementById("afterLogin").style.display = "";
                    } else {
                        _this.myPursueUserQuestions = resp.data.rows;
                        readMyPursueUserQuestionVue.$data.myPursueUserQuestions = resp.data.rows;
                        document.getElementById("afterLogin").style.display = "none";
                        document.getElementById("readMyPursueUserQuestion").style.display = "";
                    }
                })
            },

            rankByLikesCount() {
                var _this = this;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/pursueList/rankByLikesCount",
                }).then(function (resp) {
                    if (resp.data.totalCount > 0) {
                        _this.myPursueUserQuestions = resp.data.rows;
                        readMyPursueUserQuestionVue.$data.myPursueUserQuestions = resp.data.rows;
                        document.getElementById("afterLogin").style.display = "none";
                        document.getElementById("readMyPursueUserQuestion").style.display = "";
                    }
                })
            },
            rankByLaunchTime() {
                var _this = this;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/pursueList/rankByLaunchTime",
                }).then(function (resp) {
                    if (resp.data.totalCount > 0) {
                        _this.myPursueUserQuestions = resp.data.rows;
                        readMyPursueUserQuestionVue.$data.myPursueUserQuestions = resp.data.rows;
                        document.getElementById("afterLogin").style.display = "none";
                        document.getElementById("readMyPursueUserQuestion").style.display = "";
                    }
                })
            },

            goMenu() {
                document.getElementById("afterLogin").style.display = "";
                document.getElementById("readMyPursueUserQuestion").style.display = "none";
            },
        },
    });
</script>

<script>
    var readMyPursueTopicQuestionVue = new Vue({
        el: "#readMyPursueTopicQuestion",
        data() {
            return {
                myPursueTopicQuestions: [{
                    id: 1,
                    title: "问题无标题",
                    content: "问题无内容",
                    classification: "问题无分类",
                    publishUserId: 1,
                    likeCount: 0,
                    reportStatus: 1,
                    reportIllegalReason: "问题无举报原因",
                    checkStatus: 0,
                    checkIllegalReason: "问题未过审",
                    launchTime: null,
                },],
            }
        },
        methods: {
            showMyPursueTopicQuestions() {
                var _this = this;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/topicPursueList/showMyPursueTopicQuestions",
                }).then(function (resp) {

                    if (resp.data.totalCount == 0) {
                        alert("你关注的话题，尚未有用户发布过相关的问题");
                        document.getElementById("readMyPursueTopicQuestion").style.display = "none";
                        document.getElementById("afterLogin").style.display = "";
                    } else if (resp.data.totalCount == -1) {
                        alert("你还没有关注过话题，请先关注");
                        document.getElementById("readMyPursueTopicQuestion").style.display = "none";
                        document.getElementById("afterLogin").style.display = "";
                    } else {
                        _this.myPursueTopicQuestions = resp.data.rows;
                        readMyPursueTopicQuestionVue.$data.myPursueTopicQuestions = resp.data.rows;
                        document.getElementById("afterLogin").style.display = "none";
                        document.getElementById("readMyPursueTopicQuestion").style.display = "";
                    }
                })
            },
            //对关注话题的问题进行点赞排序
            rankInterestedQuestionByLikes() {
                var _this = this;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/topicPursueList/rankInterestedQuestionByLikes",
                }).then(function (resp) {
                    if (resp.data.totalCount > 0) {
                        _this.myPursueTopicQuestions = resp.data.rows;
                        readMyPursueTopicQuestionVue.$data.myPursueTopicQuestions = resp.data.rows;
                        document.getElementById("afterLogin").style.display = "none";
                        document.getElementById("readMyPursueTopicQuestion").style.display = "";
                    }
                })
            },
            rankInterestedQuestionByLaunchTime() {
                var _this = this;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/topicPursueList/rankInterestedQuestionByLaunchTime",
                }).then(function (resp) {
                    if (resp.data.totalCount > 0) {
                        _this.myPursueTopicQuestions = resp.data.rows;
                        readMyPursueTopicQuestionVue.$data.myPursueTopicQuestions = resp.data.rows;
                        document.getElementById("afterLogin").style.display = "none";
                        document.getElementById("readMyPursueTopicQuestion").style.display = "";
                    }
                })
            },

            comeBackPrevious() {
                document.getElementById("afterLogin").style.display = "";
                document.getElementById("readMyPursueTopicQuestion").style.display = "none";
            },
        },
    });
</script>

<script>
    var showNotPursueTopicsAppVue = new Vue({
        el: "#showNotPursueTopicsApp",
        data() {
            return {
                NotPursueTopics: [{
                    id: 0,
                    topicName: "",
                }],
                eachTopic: {
                    id: 0,
                    topicName: "",
                },
            }
        },
        methods: {
            showNotPursueTopics() {
                var _this = this;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/topic/showNotPursueTopics",
                }).then(function (resp) {
                    if (resp.data.totalCount == 0) {
                        alert("你关注了所有话题，请直接查看已经关注的话题");
                        document.getElementById("showNotPursueTopicsApp").style.display = "none";
                        document.getElementById("afterLogin").style.display = "";
                    } else {
                        _this.NotPursueTopics = resp.data.rows;
                        showNotPursueTopicsAppVue.$data.NotPursueTopics = resp.data.rows;
                        document.getElementById("afterLogin").style.display = "none";
                        document.getElementById("showNotPursueTopicsApp").style.display = "";
                    }
                })
            },

            pursueTopic(NotPursueTopicItem) {
                this.eachTopic = NotPursueTopicItem;
                var _this = this;
                axios({
                    method: "post",
                    url: "http://localhost:8080/demo01/topicPursueList/pursueTopic",
                    data: this.eachTopic,
                }).then(function (resp) {
                    alert(resp.data.result);
                    if (resp.data.status == 1) {
                        _this.showNotPursueTopics();
                    }
                })
            },

            comeBackApp() {
                document.getElementById("afterLogin").style.display = "";
                document.getElementById("showNotPursueTopicsApp").style.display = "none";
            },
        },
    });
</script>

<script>
    var showPursueTopicsAppVue = new Vue({
        el: "#showPursueTopicsApp",
        data() {
            return {
                pursueTopics: [{
                    id: 0,
                    topicName: "",
                }],
                eachQuitTopic: {
                    id: 0,
                    topicName: "",
                },
            }
        },
        methods: {
            showPursueTopics() {
                var _this = this;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/topic/showPursueTopics",
                }).then(function (resp) {
                    if (resp.data.totalCount == 0) {
                        alert("你没有关注的话题，请先关注");
                        document.getElementById("showPursueTopicsApp").style.display = "none";
                        document.getElementById("afterLogin").style.display = "";
                    } else {
                        _this.pursueTopics = resp.data.rows;
                        showPursueTopicsAppVue.$data.pursueTopics = resp.data.rows;
                        document.getElementById("afterLogin").style.display = "none";
                        document.getElementById("showPursueTopicsApp").style.display = "";
                    }
                })
            },

            cancelPursueTopic(pursueTopicItem) {
                this.eachQuitTopic = pursueTopicItem;
                var _this = this;
                axios({
                    method: "post",
                    url: "http://localhost:8080/demo01/topicPursueList/cancelPursueTopic",
                    data: this.eachQuitTopic,
                }).then(function (resp) {
                    alert(resp.data.result);
                    if (resp.data.status == 1) {
                        _this.showPursueTopics();
                    }
                })
            },

            goBackApp() {
                document.getElementById("afterLogin").style.display = "";
                document.getElementById("showPursueTopicsApp").style.display = "none";
            },
        },
    });
</script>

<script>
    var readMyCollectQuestionsVue = new Vue({
        el: "#readMyCollectQuestions",
        data() {
            return {
                myCollectQuestions: [{
                    id: 0,
                    userId: 0,
                    questionId: 0,
                    questionTitle: "",
                }],
                eachCollectQuestion: {
                    id: 0,
                    userId: 0,
                    questionId: 0,
                    questionTitle: "",
                },
            }
        },
        methods: {
            showMyCollectQuestions() {
                var _this = this;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/collectQuestion/showMyCollectQuestions",
                }).then(function (resp) {
                    if (resp.data.totalCount == 0) {
                        alert("你没有收藏的问题，请先收藏");
                        document.getElementById("readMyCollectQuestions").style.display = "none";
                        document.getElementById("afterLogin").style.display = "";
                    } else {
                        _this.myCollectQuestions = resp.data.rows;
                        readMyCollectQuestionsVue.$data.myCollectQuestions = resp.data.rows;
                        document.getElementById("afterLogin").style.display = "none";
                        document.getElementById("readMyCollectQuestions").style.display = "";
                    }
                })
            },

            seeQuestionDetails(myCollectQuestion) {
                this.eachCollectQuestion = myCollectQuestion;
                readQuestionDetailsVue.$data.showQuestionId = this.eachCollectQuestion.questionId;
                readQuestionDetailsVue.showQuestionDetails();
            },

            quitSeeMyCollectQuestionsButton() {
                document.getElementById("afterLogin").style.display = "";
                document.getElementById("readMyCollectQuestions").style.display = "none";
            },
        },
    });
</script>

<script>
    var readQuestionDetailsVue = new Vue({
        el: "#readQuestionDetails",
        data() {
            return {
                everyCollectQuestion: {
                    id: 1,
                    title: "问题无标题",
                    content: "问题无内容",
                    classification: "问题无分类",
                    publishUserId: 1,
                    likeCount: 0,
                    reportStatus: 1,
                    reportIllegalReason: "问题无举报原因",
                    checkStatus: 0,
                    checkIllegalReason: "问题未过审",
                    launchTime: null,
                },
                showQuestionId: 0,
            }
        },
        methods: {
            showQuestionDetails() {
                var _this = this;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/collectQuestion/showQuestionDetails?showQuestionId=" + this.showQuestionId,
                }).then(function (resp) {
                    document.getElementById("readQuestionDetails").style.display = "";
                    document.getElementById("readMyCollectQuestions").style.display = "none";
                    _this.everyCollectQuestion = resp.data.t;
                })
            },
            quitReadQuestionDetailsButton() {
                document.getElementById("readMyCollectQuestions").style.display = "";
                document.getElementById("readQuestionDetails").style.display = "none";
            },

            // cancelPursueTopic(pursueTopicItem) {
            //     this.eachQuitTopic = pursueTopicItem;
            //     var _this = this;
            //     axios({
            //         method: "post",
            //         url: "http://localhost:8080/demo01/topicPursueList/cancelPursueTopic",
            //         data: this.eachQuitTopic,
            //     }).then(function (resp) {
            //         alert(resp.data.result);
            //         if (resp.data.status == 1) {
            //             _this.showPursueTopics();
            //         }
            //     })
            // },
        },
    });
</script>

<script>

    var checkWaitingQuestionAppVue = new Vue({
        el: "#checkWaitingQuestionApp",
        data() {
            return {
                uncheckedQuestionList: [{
                    id: 1,
                    title: "问题无标题",
                    content: "问题无内容",
                    classification: "问题无分类",
                    publishUserId: 1,
                    likeCount: 0,
                    reportStatus: 1,
                    reportIllegalReason: "问题无举报原因",
                    checkStatus: 0,
                    checkIllegalReason: "问题未过审",
                    launchTime: null,
                },],
                eachUncheckedQuestion: {
                    id: 1,
                    title: "问题无标题",
                    content: "问题无内容",
                    classification: "问题无分类",
                    publishUserId: 1,
                    likeCount: 0,
                    reportStatus: 1,
                    reportIllegalReason: "问题无举报原因",
                    checkStatus: 0,
                    checkIllegalReason: "问题未过审",
                    launchTime: null,
                },
                agreedQuestionId: 0,
                disagreedQuestionId: 0,
            }
        },
        methods: {
            listUncheckedQuestions() {
                var _this = this;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/question/listUncheckedQuestions",
                }).then(function (resp) {
                    if (resp.data.totalCount == 0) {
                        alert("上传仍待审核的问题名单为空");
                        document.getElementById("checkWaitingQuestionApp").style.display = "none";
                        document.getElementById("afterAdministratorLoginApp").style.display = "";
                    } else {
                        _this.uncheckedQuestionList = resp.data.rows;
                        checkWaitingQuestionAppVue.$data.uncheckedQuestionList = resp.data.rows;
                        document.getElementById("afterAdministratorLoginApp").style.display = "none";
                        document.getElementById("checkWaitingQuestionApp").style.display = "";
                    }
                })
            },

            agreedPublishQuestion(agreedQuestion) {
                checkWaitingQuestionAppVue.$data.eachUncheckedQuestion = agreedQuestion;
                var _this = this;
                this.agreedQuestionId = agreedQuestion.id;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/question/agreedPublishQuestion?agreedQuestionId=" + this.agreedQuestionId,
                }).then(function (resp) {
                    alert(resp.data.result);
                    if (resp.data.status == 1) {
                        //刷新
                        _this.listUncheckedQuestions();
                    }
                })
            },

            disagreedPublishQuestion(disagreedQuestion) {
                checkWaitingQuestionAppVue.$data.eachUncheckedQuestion = disagreedQuestion;
                document.getElementById("rejectPublishQuestionApp").style.display = "";
                document.getElementById("checkWaitingQuestionApp").style.display = "none";
            },

            backMenu() {
                document.getElementById("afterAdministratorLoginApp").style.display = "";
                document.getElementById("checkWaitingQuestionApp").style.display = "none";
            },
        },
    });
</script>

<script>
    var checkReportedQuestionAppVue = new Vue({
        el: "#checkReportedQuestionApp",
        data() {
            return {
                reportedQuestionList: [{
                    id: 1,
                    title: "问题无标题",
                    content: "问题无内容",
                    classification: "问题无分类",
                    publishUserId: 1,
                    likeCount: 0,
                    reportStatus: 1,
                    reportIllegalReason: "问题无举报原因",
                    checkStatus: 0,
                    checkIllegalReason: "问题未过审",
                    launchTime: null,
                },],
                eachReportedQuestion: {
                    id: 1,
                    title: "问题无标题",
                    content: "问题无内容",
                    classification: "问题无分类",
                    publishUserId: 1,
                    likeCount: 0,
                    reportStatus: 1,
                    reportIllegalReason: "问题无举报原因",
                    checkStatus: 0,
                    checkIllegalReason: "问题未过审",
                    launchTime: null,
                },
                agreedReportQuestionId: 0,
                disagreedReportQuestionId: 0,
            }
        },
        methods: {
            listReportedQuestions() {
                var _this = this;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/question/listReportedQuestions",
                }).then(function (resp) {
                    if (resp.data.totalCount == 0) {
                        alert("举报待审核的问题名单为空");
                        document.getElementById("checkReportedQuestionApp").style.display = "none";
                        document.getElementById("afterAdministratorLoginApp").style.display = "";
                    } else {
                        _this.reportedQuestionList = resp.data.rows;
                        checkReportedQuestionAppVue.$data.reportedQuestionList = resp.data.rows;
                        document.getElementById("afterAdministratorLoginApp").style.display = "none";
                        document.getElementById("checkReportedQuestionApp").style.display = "";
                    }
                })
            },

            agreedReportQuestion(agreedQuestionReported) {
                checkReportedQuestionAppVue.$data.eachReportedQuestion = agreedQuestionReported;
                var _this = this;
                this.agreedReportQuestionId = agreedQuestionReported.id;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/question/agreedReportQuestion?agreedReportQuestionId=" + this.agreedReportQuestionId,
                }).then(function (resp) {
                    alert(resp.data.result);
                    if (resp.data.status == 1) {
                        //刷新
                        _this.listReportedQuestions();
                    }
                })
            },

            disagreedReportQuestion(disagreedQuestionReported) {
                checkReportedQuestionAppVue.$data.eachReportedQuestion = disagreedQuestionReported;
                var _this = this;
                this.disagreedReportQuestionId = disagreedQuestionReported.id;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/question/disagreedReportQuestion?disagreedReportQuestionId="
                        + this.disagreedReportQuestionId,
                }).then(function (resp) {
                    alert(resp.data.result);
                    if (resp.data.status == 1) {
                        //刷新
                        _this.listReportedQuestions();
                    }
                })
            },

            returnMenu() {
                document.getElementById("afterAdministratorLoginApp").style.display = "";
                document.getElementById("checkReportedQuestionApp").style.display = "none";
            },
        },
    });
</script>

<script>
    var checkReportedCommentAppVue = new Vue({
        el: "#checkReportedCommentApp",
        data() {
            return {
                reportedCommentList: [{
                    id: 1,
                    content: "评论无内容",
                    answerCommentUserId: 1,
                    answerId: 1,
                    answerUserId: 1,
                    reportStatus: 1,
                    reportIllegalReason: "评论无举报原因",
                    commentUserName: "评论者为匿名",
                },],
                eachReportedComment: {
                    id: 1,
                    content: "评论无内容",
                    answerCommentUserId: 1,
                    answerId: 1,
                    answerUserId: 1,
                    reportStatus: 1,
                    reportIllegalReason: "评论无举报原因",
                    commentUserName: "评论者为匿名",
                },
                agreedReportCommentId: 0,
                disagreedReportCommentId: 0,
            }
        },
        methods: {
            listReportedComments() {
                var _this = this;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/answerComment/listReportedComments",
                }).then(function (resp) {
                    if (resp.data.totalCount == 0) {
                        alert("举报待审核的评论名单为空");
                        document.getElementById("checkReportedCommentApp").style.display = "none";
                        document.getElementById("afterAdministratorLoginApp").style.display = "";
                    } else {
                        _this.reportedCommentList = resp.data.rows;
                        checkReportedCommentAppVue.$data.reportedCommentList = resp.data.rows;
                        document.getElementById("afterAdministratorLoginApp").style.display = "none";
                        document.getElementById("checkReportedCommentApp").style.display = "";
                    }
                })
            },

            agreedReportComment(agreedCommentReported) {
                checkReportedCommentAppVue.$data.eachReportedComment = agreedCommentReported;
                var _this = this;
                this.agreedReportCommentId = agreedCommentReported.id;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/answerComment/agreedReportComment?agreedReportCommentId=" + this.agreedReportCommentId,
                }).then(function (resp) {
                    alert(resp.data.result);
                    if (resp.data.status == 1) {
                        //刷新
                        _this.listReportedComments();
                    }
                })
            },

            disagreedReportComment(disagreedCommentReported) {
                checkReportedCommentAppVue.$data.eachReportedComment = disagreedCommentReported;
                var _this = this;
                this.disagreedReportCommentId = disagreedCommentReported.id;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/answerComment/disagreedReportComment?disagreedReportCommentId="
                        + this.disagreedReportCommentId,
                }).then(function (resp) {
                    alert(resp.data.result);
                    if (resp.data.status == 1) {
                        //刷新
                        _this.listReportedComments();
                    }
                })
            },

            toMenu() {
                document.getElementById("afterAdministratorLoginApp").style.display = "";
                document.getElementById("checkReportedCommentApp").style.display = "none";
            },
        },
    });
</script>

<script>
    var setUserPrivilegeVue = new Vue({
        el: "#setUserPrivilege",
        data() {
            return {
                totalUsers: [{
                    id: 1,
                    content: "评论无内容",
                    answerCommentUserId: 1,
                    answerId: 1,
                    answerUserId: 1,
                    reportStatus: 1,
                    reportIllegalReason: "评论无举报原因",
                    commentUserName: "评论者为匿名",
                },],
                userPermissions: [{
                    id: 0,
                    permissionName: "111",
                },],
                PermissionBlacklist: [{
                    id: 0,
                    banPermissionName: "",
                    banUserId: 0,
                    openDate: "",
                    banPermissionId: 0,
                },],
                eachPermissionInBlacklist: {
                    id: 0,
                    banPermissionName: "",
                    banUserId: 0,
                    openDate: "",
                    banPermissionId: 0,
                },
                losePermissionId: 0,
            }
        },
        methods: {
            listUserPrivileges() {
                var _this = this;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/permissionBlacklist/listUserPrivileges",
                }).then(function (resp) {
                    if (resp.data.userSize == 0) {
                        alert("当前系统还没有用户");
                        document.getElementById("setUserPrivilege").style.display = "none";
                        document.getElementById("afterAdministratorLoginApp").style.display = "";
                    } else {
                        //刷新数据
                        _this.totalUsers = resp.data.userLists;
                        setUserPrivilegeVue.$data.totalUsers = resp.data.userLists;
                        _this.userPermissions = resp.data.permissionLists;
                        setUserPrivilegeVue.$data.userPermissions = resp.data.permissionLists;
                        _this.PermissionBlacklist = resp.data.permissionBlacklistLists;
                        setUserPrivilegeVue.$data.PermissionBlacklist = resp.data.permissionBlacklistLists;
                        document.getElementById("afterAdministratorLoginApp").style.display = "none";
                        document.getElementById("setUserPrivilege").style.display = "";
                    }
                })
            },

            setUserPrivilege(perUser) {
                this.eachPermissionInBlacklist.banUserId = perUser.id;
                var _this = this;
                axios({
                    method: "post",
                    url: "http://localhost:8080/demo01/permissionBlacklist/setUserPrivilege",
                    data: this.eachPermissionInBlacklist,
                }).then(function (resp) {
                    alert(resp.data.result);
                    if (resp.data.status == 1) {
                        //刷新
                        _this.listUserPrivileges();
                    }
                })
            },

            cancelSetUserPrivilege(losePermission) {
                this.losePermissionId = losePermission.id;
                var _this = this;
                axios({
                    methods: "get",
                    url: "http://localhost:8080/demo01/permissionBlacklist/cancelSetUserPrivilege?losePermissionId=" + _this.losePermissionId,
                }).then(function (resp) {
                    alert(resp.data.result);
                    if (resp.data.status == 1) {
                        //刷新
                        _this.listUserPrivileges();
                    }
                })
            },

            quitSetUserPrivilege() {
                document.getElementById("afterAdministratorLoginApp").style.display = "";
                document.getElementById("setUserPrivilege").style.display = "none";
            },
        },
    });
</script>

<script>
    var editImageAppVue = new Vue({
        el: "#editImageApp",
        data() {
            return {
                editImagePath: "http://localhost:8080/demo01/uploads/0.jpg",
            }
        },
        methods: {
            cancelEditImage() {
                document.getElementById("afterLogin").style.display = "";
                document.getElementById("editImageApp").style.display = "none";
            },
            handleFileChange(event) {
                const file = event.target.files[0]
                const formData = new FormData()
                formData.append('file', file)
                // 发送上传文件的请求
                axios.post('http://localhost:8080/demo01/user/editImage', formData)
                    .then(response => {
                        if (response.data.status == 0) {
                            alert(response.data.result);
                        } else {
                            this.editImagePath = response.data.t.imagePath;
                            afterLoginVue.$data.user.imagePath = response.data.t.imagePath;
                            alert(response.data.result);
                        }
                    })
                    .catch(error => {
                        alert("上传失败");
                    })
            }
        },
    });
</script>

</html>
